comefrom: <doocs>1351.Count Negative Numbers in a Sorted Matrix_1.py
code: def countNegatives( grid: List[List[int]]) -> int:
      m, n = len(grid), len(grid[0])
      i, j = m - 1, 0
      ans = 0
      while i >= 0 and j < n:
          if grid[i][j] < 0:
              ans += n - j
              i -= 1
          else:
              j += 1
      return ans
masked: def sample_funcname ( var_0 : List [ List [ int ] ] ) -> int :
      var_1 , var_2 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_3 , var_4 = var_1 - 1 , 0
      var_5 = 0
      while var_3 >= 0 and var_4 < var_2 :
          if var_0 [ var_3 ] [ var_4 ] < 0 :
              var_5 += var_2 - var_4
              var_3 -= 1
          else :
              var_4 += 1
      return var_5
  