Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
For each <code>nums[i]</code>, we can maintain each subarray’s bitwise <code>OR</code> result ending with it.
The property of bitwise <code>OR</code> is that it never unsets any bits and only sets new bits
So the number of different results for each <code>nums[i]</code> is at most the number of bits 32.