Leetcode 278 First Bad Version
All the versions after a bad version are also bad.
Approach 2 (Binary Search)
How about the terminating condition?
We could guess that left and right eventually both meet and it must be the first bad version, but How could you tell for sure?
If isBad(mid) == false, l = mid+1;
else r= mid