C++/Python, solution with explanation
First, we can transform targetSeconds into minute: second where second < 60, another choice is to transform a minute into 60 second,\nminute-1: second+60, and r
First, we can transform targetSeconds into ```minute: second``` where ```second < 60```, another choice is to transform a minute into 60 second,\n```minute-1: second+60```, and return min cost between two choices.\n\n### c++\n```cpp\nclass Solution {\npublic:\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        auto cost = [&] (int pos, int minute, int second) {\n            if (min(minute, second) < 0 || max(minute, second) > 99) return INT_MAX;\n            int cost = 0;\n            for (auto ch: to_string(minute * 100 + second)) {\n                cost += pushCost + (pos != ch - \'0\'? moveCost: 0);\n                pos = ch - \'0\';\n            }\n            return cost;\n        };\n        int m = targetSeconds / 60, s = targetSeconds % 60; \n        return min(cost(startAt, m, s), cost(startAt, m-1, s+60));\n    }\n};\n```\n### python\n```python\nclass Solution:\n    def minCostSetTime(self, startAt: int, moveCost: int, pushCost: int, targetSeconds: int) -> int:\n        def cost(pos, minute, second):\n            if min(minute, second) < 0 or max(minute, second) > 99: return float(\'inf\')\n            cost = 0\n            for ch in str(minute * 100 + second):\n                cost += pushCost + (moveCost if int(ch) != pos else 0)\n                pos = int(ch)\n            return cost\n        minute, second = targetSeconds // 60, targetSeconds % 60\n        return min(cost(startAt, minute, second), cost(startAt, minute-1, second+60))\n```
['C', 'Python']