comefrom: <doocs>2079.Watering Plants_1.py
code: def wateringPlants( plants: List[int], capacity: int) -> int:
      ans, cap = 0, capacity
      for i, x in enumerate(plants):
          if cap >= x:
              cap -= x
              ans += 1
          else:
              cap = capacity - x
              ans += i * 2 + 1
      return ans
masked: def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> int :
      var_5 , var_6 = 0 , var_3
      for var_8 , var_9 in enumerate ( var_0 ) :
          if var_6 >= var_9 :
              var_6 -= var_9
              var_5 += 1
          else :
              var_6 = var_3 - var_9
              var_5 += var_8 * 2 + 1
      return var_5
  