Watering Plants
You are given an array representing the heights of plants and a capacity value representing the maximum number of units of water that can be held by the watering can. Each plant can be watered based on its height, and you can refill the watering can at the river. Write a function to find the minimum steps required to water all the plants.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)