You've learned binary search patterns. The basic binary search template uses left <= right and moves left/right past mid. Use this for finding exact matches. For rotated arrays, identify which half is sorted and determine where the target (or minimum) must be. For boundary finding, use left < right and set right = mid. The loop converges on the boundary. Binary search applies whenever you can eliminate half the search space. It's not just for "find X in sorted array." It's for any monotonic property.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/binary-search/section-recap
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████████████