A microwave has a keypad with digits from mm:ss, representing minutes and seconds. The displayed time can be set by typing a sequence of
When a sequence of digits is entered:
The entered sequence represents the number of minutes and seconds, where the last
Entering fewer than d1, d2, d3 is interpreted as 0d1:d2d3 (
The total cooking time in seconds is calculated as $ ext{minutes} imes 60 + ext{seconds}$.
Both minutes and seconds can range from
You are given four integers: startAt, moveCost, pushCost, and targetSeconds.
Initially, your finger is positioned over the digit startAt.
Moving your finger from the current digit to a different digit costs moveCost. Moving to the same digit costs
Pressing the button under your finger costs pushCost.
Return the minimum cost to set the microwave to cook for exactly targetSeconds seconds.
Constraints:
startAt
moveCost, pushCost
targetSeconds
A microwave has a keypad with digits from mm:ss, representing minutes and seconds. The displayed time can be set by typing a sequence of
When a sequence of digits is entered:
The entered sequence represents the number of minutes and seconds, where the last
Entering fewer than d1, d2, d3 is interpreted as 0d1:d2d3 (
The total cooking time in seconds is calculated as $ ext{minutes} imes 60 + ext{seconds}$.
Both minutes and seconds can range from
You are given four integers: startAt, moveCost, pushCost, and targetSeconds.
Initially, your finger is positioned over the digit startAt.
Moving your finger from the current digit to a different digit costs moveCost. Moving to the same digit costs
Pressing the button under your finger costs pushCost.
Return the minimum cost to set the microwave to cook for exactly targetSeconds seconds.
Constraints:
startAt
moveCost, pushCost
targetSeconds