[Python 3] Solution and Explanation 😤Edge Cases Sucks 😤
\n# [Python 3] Solution and Explanation\uD83D\uDE24Edge Cases Sucks \uD83D\uDE24\n\n## MAIN IDEA\nWe make targetSeconds into a list to store which buttons we ha
\n# [Python 3] Solution and Explanation\uD83D\uDE24Edge Cases Sucks \uD83D\uDE24\n\n## MAIN IDEA\nWe make targetSeconds into a list to store which buttons we have to press on, and then **calculateCost** to calculate actual cost finally return min cost.\n\n## Cases\n> 1\uFE0F\u20E3 If **targetSeconds < 100** we can directly append a buttonList bt sperate digit in targetSeconds\n> 2\uFE0F\u20E3 We calculate seconds into minutes + remain seconds, but be careful minutes will **greater than 100** \uD83D\uDE24 we have to round it down to seconds.\n> 3\uFE0F\u20E3 In the example we could make 10:00 to 9:60 when second part is **smaller than 40** (dont have to carry in) and **minutes greater than 1**\n\n## Complexity Analysis\n* Time : O(1)\n* Space: O(1)\n\n\n## Code\n```\nclass Solution:\n    def minCostSetTime(self, startAt: int, moveCost: int, pushCost: int, targetSeconds: int) -> int:\n        buttons = []\n        if targetSeconds < 100:\n            buttons.append([int(c) for c in str(targetSeconds)])\n            \n        minTargets = targetSeconds // 60 * 100 + targetSeconds % 60\n        if minTargets // 100 < 100:\n            buttons.append([int(c) for c in str(minTargets)])\n            \n        if minTargets % 100 < 40 and minTargets > 200:\n            newTarget = minTargets - 100 + 60\n            buttons.append([int(c) for c in str(newTarget)])\n            \n        minCost = float(\'inf\')\n        \n        for buttonList in buttons:\n            currentCost = self.calculateCost(startAt, moveCost, pushCost, buttonList)\n            minCost = min(minCost, currentCost)\n        return minCost\n            \n            \n    def calculateCost(self, startAt, moveCost, pushCost, targetButtons):\n        cost = 0\n        for button in targetButtons:\n            if button != startAt:\n                cost += moveCost\n                startAt = button\n            cost += pushCost\n        return cost\n```\n* See more 2022 Daily Challenge Solution : [GitHub](https://github.com/gcobs0834/2022-Daily-LeetCoding-Challenge-python3-)
[]