Leetcode 2162. Minimum Cost to Set Cooking Time
Given start digit, moveCost, pushCost and targetSeconds, find the minimum fatigue to enter up to four digits (zero-padded to MMSS) whose minutes*60 + seconds = targetSeconds, where each digit press costs pushCost and moving the finger between different digits costs moveCost (starting at startAt). The problem reduces to checking all valid minute/second splits that sum to targetSeconds and computing the minimal move+push cost for their digit sequences.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late December, 2024
Mid-level
Microwave optimal keystroke input
Mid December, 2024
Mid-level
Microwave optimal keystroke input: Given a target cooking time and costs for keystrokes, find the optimal input sequence. Each keystroke costs 1, moving finger to a different key costs 2. Input must be within 10% of target time. If costs are equal, choose input closest to target. Example: for 10 minutes target, 888 is optimal.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.