#=================================== # Tanzila Islam # Email: tanzilamohita@gmail.com # Language: Python 3 #=================================== # The isBadVersion API is already defined for you. # def isBadVersion(version: int) -> bool: class Solution: def firstBadVersion(self, n: int) -> int: low = 1 high = n while low < high: mid = int((low+high)/2) if isBadVersion(mid): high = mid else: low = mid + 1 return low
No comments:
Post a Comment