← Discussions on First Bad Version
H harini_13
20 Aug 2026, 17:58

Simple approach explained for beginners.

The answer space is monotonic, so binary search on it. Be careful with the loop condition (lo < hi vs lo <= hi) and how you move the bounds.

0 replies

Sign in to reply.