Leetcode 3097. Shortest Subarray With OR at Least K II
Find the length of the shortest non-empty contiguous subarray whose bitwise OR is at least k (return -1 if none). With n up to 2e5 and OR being monotonic when extending a range, the challenge is to design an efficient near-linear solution that tracks set bits across windows to minimize subarray length.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.