Return the minimum length of a nonempty contiguous subarray whose bitwise OR is at least k. If no such subarray exists, return -1. The bitwise OR has a bit set whenever at least one number in the subarray has that bit set.
Example 1:
Input: nums = [1,4,2]
k = 7
Output: 3Explanation: The OR of all three elements is 7. Every shorter contiguous subarray has OR below 7, so the minimum length is 3.
Example 2:
Input: nums = [0,0]
k = 1
Output: -1Explanation: Any subarray consists entirely of zeros, whose OR is zero. None reaches 1.
Example 3:
Input: nums = [0]
k = 0
Output: 1Explanation: The single zero has OR equal to the target 0. A nonempty subarray must contain at least one element, so the answer is 1.
Constraints:
1 <= nums.length <= 2000000 <= nums[i] <= 10000000000 <= k <= 1000000000