first, reshuffle indices so 𝑎=1𝑛

for each 𝑏𝑖, want to find largest subarray such that it’s some prefix of indices

for instance 𝑏=[5,1,4,2,3]

segments [13], [23], [33] (this is the maximum)

can be done by querying smallest empty value