Compute the bitwise AND of each nonempty contiguous subarray of nums. Among the subarrays that attain the largest possible AND value, return the greatest length.
Example 1:
Input: nums = [1]
Output: 1Explanation: The only subarray is [1], whose bitwise AND is 1 and whose length is 1.
Example 2:
Input: nums = [1,1]
Output: 2Explanation: The greatest possible AND is 1. The entire array [1,1] attains it, giving length 2.
Example 3:
Input: nums = [1,2]
Output: 1Explanation: The greatest possible AND is 2, attained by the one-entry subarray [2]. The whole array has AND 0.
Constraints:
1 <= nums.length <= 1000001 <= nums[i] <= 1000000