comefrom: <doocs>2105.Watering Plants II_1.py
code: def minimumRefill( plants: List[int], capacityA: int, capacityB: int) -> int:
      i, j = 0, len(plants) - 1
      ans = 0
      a, b = capacityA, capacityB
      while i <= j:
          if i == j:
              if max(capacityA, capacityB) < plants[i]:
                  ans += 1
              break
          if capacityA < plants[i]:
              capacityA = a - plants[i]
              ans += 1
          else:
              capacityA -= plants[i]
          if capacityB < plants[j]:
              capacityB = b - plants[j]
              ans += 1
          else:
              capacityB -= plants[j]
          i += 1
          j -= 1
      return ans
masked: def sample_funcname ( var_0 : List [ int ] , var_3 : int , var_4 : int ) -> int :
      var_6 , var_9 = 0 , len ( var_0 ) - 1
      var_10 = 0
      var_11 , var_12 = var_3 , var_4
      while var_6 <= var_9 :
          if var_6 == var_9 :
              if max ( var_3 , var_4 ) < var_0 [ var_6 ] :
                  var_10 += 1
              break
          if var_3 < var_0 [ var_6 ] :
              var_3 = var_11 - var_0 [ var_6 ]
              var_10 += 1
          else :
              var_3 -= var_0 [ var_6 ]
          if var_4 < var_0 [ var_9 ] :
              var_4 = var_12 - var_0 [ var_9 ]
              var_10 += 1
          else :
              var_4 -= var_0 [ var_9 ]
          var_6 += 1
          var_9 -= 1
      return var_10
  