Created
March 3, 2020 14:35
-
-
Save deque-blog/bf57b8ac155408ce76d4abdb3acb34c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_guilty_commit(commits: List[CommitId]) -> Optional[CommitId]: | |
lo = 0 | |
hi = len(commits) - 1 | |
while lo <= hi: | |
mid = lo + (hi - lo) // 2 | |
if is_test_failing(commits[mid]): | |
hi = mid - 1 | |
else: | |
lo = mid + 1 | |
return commits[lo] if lo < len(commits) else None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment