Python3 | Beats 100% time
\nclass Solution:\n    def minCostSetTime(self, startAt: int, moveCost: int, pushCost: int, targetSeconds: int) -> int:\n        poss = [(targetSeconds // 60, t
```\nclass Solution:\n    def minCostSetTime(self, startAt: int, moveCost: int, pushCost: int, targetSeconds: int) -> int:\n        poss = [(targetSeconds // 60, targetSeconds % 60)]  # store possibilities as (minutes, seconds)\n        \n        if poss[0][0] > 99:  # for when targetSeconds >= 6000\n            poss = [(99, poss[0][1]+60)]\n            \n        if poss[0][0] >= 1 and (poss[0][1]+60) <= 99:\n\t\t\t# adding a second possibility e.g. (01, 16) -> (0, 76)\n            poss.append((poss[0][0]-1, poss[0][1]+60))\n            \n        costs = list()\n        \n        for i in poss:\n            curr_start = startAt\n            curr_cost = 0\n            \n            minutes = str(i[0])\n            if i[0] != 0:  # 0s are prepended, so no need to push 0s\n                for j in minutes:\n                    if int(j) != curr_start:\n                        curr_cost += moveCost\n                        curr_start = int(j)\n                    curr_cost += pushCost\n                    \n            seconds = str(i[1])\n            if len(seconds) == 1 and i[0] != 0:  # seconds is a single digit, prepend a "0" to it\n                seconds = "0" + seconds\n            \n            for j in seconds:\n                if int(j) != curr_start:\n                    curr_cost += moveCost\n                    curr_start = int(j)\n                curr_cost += pushCost\n            costs.append(curr_cost)\n            \n        return min(costs)\n```
['Python', 'Python3']