comefrom: <qiyuangong>074_Search_a_2D_Matrix_2.py
code: def searchMatrix( matrix, target):
      try:
          ls_row, ls_col = len(matrix), len(matrix[0])
      except:
          return False
      if target < matrix[0][0] or target > matrix[-1][-1]:
          return False
      begin, end = 0, ls_row * ls_col - 1
      while begin <= end:
          mid = (begin + end) / 2
          row, col = mid / ls_col, mid % ls_col
          if matrix[row][col] == target:
              return True
          elif matrix[row][col] > target:
              end = mid - 1
          else:
              begin = mid + 1
      return False
masked: def sample_funcname ( var_0 , var_1 ) :
      try :
          var_3 , var_5 = len ( var_0 ) , len ( var_0 [ 0 ] )
      except :
          return False
      if var_1 < var_0 [ 0 ] [ 0 ] or var_1 > var_0 [ - 1 ] [ - 1 ] :
          return False
      var_8 , var_9 = 0 , var_3 * var_5 - 1
      while var_8 <= var_9 :
          var_11 = ( var_8 + var_9 ) / 2
          var_12 , var_13 = var_11 / var_5 , var_11 % var_5
          if var_0 [ var_12 ] [ var_13 ] == var_1 :
              return True
          elif var_0 [ var_12 ] [ var_13 ] > var_1 :
              var_9 = var_11 - 1
          else :
              var_8 = var_11 + 1
      return False
  