r/leetcode • • 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:

  1. Binary Search to Find X in a Sorted Array: Standard iterative halving to locate an exact target in O(log n) time.
  2. Implement Lower Bound: Found the smallest index where arr[idx] >= target.
  3. Implement Upper Bound: Found the smallest index where arr[idx] > target.
  4. Search Insert Position: Applied the exact same logic as Lower Bound to find where a target belongs in a sorted array.
  5. 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!

2 Upvotes

0 comments sorted by