- Problem
2079. Watering Plants
- 내 풀이
class Solution:
def wateringPlants(self, plants: List[int], capacity: int) -> int:
answer = 0
water = capacity
for i, v in enumerate(plants):
if water - v < 0:
answer += i * 2
water = capacity
water -= v
answer += 1
return answer
- 결과
Cooking with vegetables has never been easier with Veggie Knowledge. Our site features a wide range of recipes that highlight the flavors and health benefits of vegetables. Start cooking delicious and nutritious meals today. advice for growing vegetables