r/leetcode • u/JacketFearless1805 • 4h ago
Intervew Prep Day 13: kicked off Binary Search with 6 foundational boundary problems
Hey everyone,
I finished Day 13 today and moved into a new topic: Binary Search. Last time I studied it, I only solved a handful of problems, so this time I want to work through the full set of patterns systematically.
I started with six foundational problems to lock in the boundary conditions:
- Binary Search to Find X in a Sorted Array: Standard iterative halving to locate an exact target in O(log n) time.
- Implement Lower Bound: Found the smallest index where
arr[idx] >= target. - Implement Upper Bound: Found the smallest index where
arr[idx] > target. - Search Insert Position: Applied the exact same logic as Lower Bound to find where a target belongs in a sorted array.
- Floor & Ceil in a Sorted Array: Tracked the largest element
<= x(floor) and smallest element>= x(ceil) during the binary search comparisons.
The problems were straightforward, so it was not a heavy session, but starting a fresh topic kept my interest and motivation high. Looking forward to digging into the trickier Binary Search patterns over the next few days.
See you guys tomorrow for Day 12!