3296. Minimum Number of Seconds to Make Mountain Height Zero
You are given an integer
mountainHeight
denoting the height of a mountain.
You are also given an integer arrayworkerTimes
representing the work time of workers in seconds.
The workers work simultaneously to reduce the height of the mountain. For workeri
:
To decrease the mountain’s height by
x
, it takesworkerTimes[i] + workerTimes[i] * 2 + ... + workerTimes[i] * x
seconds. For example:To reduce the height of the mountain by 1, it takes
workerTimes[i]
seconds.- To reduce the height of the mountain by 2, it takes
workerTimes[i] + workerTimes[i] * 2
seconds, and so on.Return an integer representing the minimum number of seconds required for the workers to make the height of the mountain 0.
1 | class Solution { |