2162. Minimum Cost to Set Cooking Time.cpp
Code\n\nclass Solution {\npublic:\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int minute = targetSeconds/60, 
**Code**\n```\nclass Solution {\npublic:\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int minute = targetSeconds/60, second = targetSeconds%60; \n        int ans = INT_MAX; \n        for (auto& [m, s] : vector<pair<int, int>>{{minute, second}, {minute-1, second+60}}) {\n            if (0 <= m && m < 100 && s < 100) {\n                int cost = 0, prev = startAt; \n                bool found = false; \n                for (auto& x : {m/10, m%10, s/10, s%10}) \n                    if (x || found) {\n                        if (x != prev) {cost += moveCost; prev = x;}\n                        cost += pushCost; \n                        found = true; \n                    }\n                ans = min(ans, cost); \n            }\n        }\n        return ans; \n    }\n};\n```
['C']