Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Define a separate function Cost(mm, ss) where 0 <= mm <= 99 and 0 <= ss <= 99. This function should calculate the cost of setting the cooking time to mm minutes and ss seconds
The range of the minutes is small (i.e., [0, 99]), how can you use that?
For every mm in [0, 99], calculate the needed ss to make mm:ss equal to targetSeconds and minimize the cost of setting the cooking time to mm:ss
Be careful in some cases when ss is not in the valid range [0, 99].