#3097
Shortest Subarray With OR at Least K II
specialist · 875 · lc medium +31 · 50.2% accepted · 758 likes · top 38%
Description
Given a non-negative integer array nums and integer k, a subarray is special if the bitwise OR of its elements is at least k. Return the length of the shortest non-empty special subarray, or -1 if none exists.
Code
1
2
3