Relevant Patterns
#Study these pattern guides before tackling the problems. Understanding the core concepts will help you solve them more efficiently.
Practice Problems
#Easy#278
Show 2 hints
- Treat isBadVersion(mid) as monotonic predicate.
- Steer hi = mid on True to find first bad (lower bound).
Show 2 hints
- Run two boundary searches: < target for left, <= target for right.
- Return [-1,-1] if target not present.
Medium#33
Show 2 hints
- At mid, one side is sorted; choose side where target could lie.
- Avoid explicit pivot search; compare against nums[lo]/nums[mid]/nums[hi].
Medium#875
Show 2 hints
- Binary search on eating speed; hours is monotone in speed.
- Use ceiling division when computing hours for a speed.
Medium#1011
Show 2 hints
- Search minimal capacity; feasibility check simulates one pass packing days.
- lo = max(weight), hi = sum(weight).
Track Your Progress
Mark problems as complete as you solve them. Come back anytime to continue where you left off.