| 9 | |
| 10 | # Solution:(Approach 1) |
| 11 | class Solution: |
| 12 | def firstBadVersion(self, n): |
| 13 | """ |
| 14 | :type n: int |
| 15 | :rtype: int |
| 16 | """ |
| 17 | left,right=0,n |
| 18 | while left < right: |
| 19 | mid = left + (right - left) // 2 |
| 20 | if isBadVersion(mid): |
| 21 | right = mid |
| 22 | else: |
| 23 | left = mid + 1 |
| 24 | return left |
nothing calls this directly
no outgoing calls
no test coverage detected