This problem teaches binary search on a modified sorted array — recognizing which half is sorted and which contains the pivot is a key skill.
Enable JavaScript for the full StreamPrep guide.