We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e147dcd commit e2fd78eCopy full SHA for e2fd78e
python/0278-first-bad-version.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def firstBadVersion(self, n: int) -> int:
3
+ l, r = 1, n
4
+ while l < r:
5
+ v = (l + r) // 2
6
+ if isBadVersion(v):
7
+ r = v
8
+ else:
9
+ l = v + 1
10
+ return l
0 commit comments