code: def firstBadVersion(self, n):
      """
      :type n: int
      :rtype: int
      """
      left, right = 1, n
      while left < right:
          mid = (right + left) / 2
          if isBadVersion(mid):
              right = mid
          else:
              left = mid + 1
      return left
  
label_desc: Use image node_id 1 for calling the Solution obj's underlying member method code with example usage: obj.firstBadVersion(n) and returns: left