Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Split the array into segments. Each segment contains consecutive elements with the same number of set bits.
From left to right, the previous segment’s largest element should be smaller than the current segment’s smallest element.