← ALL NOTES
Array

2419. Longest Subarray With Maximum Bitwise AND

The bitwise AND of a subarray only decreases (or stays equal) as you add elements, so the maximum possible AND over all subarrays equals the array's maximum element. Find the length of the longest…

Loading…