MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / Solution

Class Solution

LeetCode_problems/first-bad-version/Solution.py:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10# Solution:(Approach 1)
11class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected