Question: 278. First Bad Version
Intution:
Time Complexity:
Space Complexity:
Solution:
public class Solution extends VersionControl {
public int firstBadVersion(int n) {
int low = 1;
int high = n;
while (low < high) {
int mid = low + (high - low) / 2;
if (isBadVersion(mid))
high = mid;
else
low = mid + 1;
}
return low;
}
}