If isBadVersion(mid) is true, why keep mid?
Practice this question from First Bad Version - Predicate search Pattern Practice Quiz, with options and an explanation.
Question
If isBadVersion(mid) is true, why keep mid?
Option A — Correct answer
Because mid might be the first bad version
Option B
Because mid is definitely good
Option C
Because all later versions are good
Option D
Because target is stored in nums[mid]
Explanation
Mid could be the first bad version, so right should move to mid.