[LeetCode] Smallest Subarrays With Maximum Bitwise OR

1 · · Sept. 17, 2022, 4:14 p.m.
2411. Smallest Subarrays With Maximum Bitwise OR You are given a 0-indexed array nums of length n, consisting of non-negative integers. For each index i from 0 to n - 1, you must determine the size of the minimum sized non-empty subarray of nums starting at i (inclusive) that has the maximum possible bitwise OR. In other words, let Bij be the bitwise OR of the subarray nums[i…j]. You need to find the smallest subarray starting at i, such that bitwise OR of this subarray is equal to max(Bik) wh...