Help needed in Atcoder Regular contest 165 task b

Revision en1, by tanishq2507, 2023-10-10 12:04:32

Link to the problem...

I have tried this approach.Try to sort the subarray closer to the last index.Shift the window towards lefts if the new element in left is smaller than all the elements in the new window but this approach fails in one case.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English tanishq2507 2023-10-10 12:04:32 350 Initial revision (published)