0ms Java
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(targetSeconds / 60)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    int minCost = 1000000;\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int mins = targetSeconds / 60; \n        int sec = targetSeconds % 60;\n        \n        while (sec <= 99 && mins >= 0){\n            if(mins <= 99) { \n            int c = cost(mins, sec, pushCost, moveCost, startAt);\n            minCost = Math.min(minCost, c);}\n            mins--;\n            sec+=60;\n        } \n\n        return minCost;\n    }\n    public int cost(int min, int sec, int pushCost, int moveCost, int startAt) {\n        int[] a = new int[]{min/10, min%10, sec / 10, sec % 10};\n        int prev = startAt;\n        int i = 0, push = 0, move = 0;\n        while(a[i] == 0) i++;\n        while(i < 4) {\n            if(a[i] != prev) {\n                move++;\n                prev = a[i];\n            }\n            push++;\n            i++;\n        }\n        return (push * pushCost) + (move * moveCost);\n    }\n}\n```
['Java']