Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Seconds to Make Mountain Height Zero

med
30 min
Try to solve the Minimum Number of Seconds to Make Mountain Height Zero problem.

Statement

You are given an integer mountainHeight and an integer array workerTimes.

Several workers work simultaneously to reduce the height of the mountain. If worker i decides to decrease the mountain height by xx, the time required is workerTimes[i] $ imes (1 + 2 + \dots + x)$ seconds.

Return the minimum number of seconds required to reduce the mountain height to 00.

Constraints:

  • 1≤1 \leq mountainHeight ≤105\leq 10^5

  • 1≤1 \leq workerTimes.length ≤104\leq 10^4

  • 1≤1 \leq workerTimes[i] ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Number of Seconds to Make Mountain Height Zero

med
30 min
Try to solve the Minimum Number of Seconds to Make Mountain Height Zero problem.

Statement

You are given an integer mountainHeight and an integer array workerTimes.

Several workers work simultaneously to reduce the height of the mountain. If worker i decides to decrease the mountain height by xx, the time required is workerTimes[i] $ imes (1 + 2 + \dots + x)$ seconds.

Return the minimum number of seconds required to reduce the mountain height to 00.

Constraints:

  • 1≤1 \leq mountainHeight ≤105\leq 10^5

  • 1≤1 \leq workerTimes.length ≤104\leq 10^4

  • 1≤1 \leq workerTimes[i] ≤106\leq 10^6