20240508 2079 - Medium - Pointer
class Solution:
def wateringPlants(self, plants: List[int], capacity: int) -> int:
steps = 0
c = capacity
for i in range(len(plants)):
steps += 1
if c < plants[i]:
steps += i * 2
c = capacity
c -= plants[i]
return steps