Intuitive Java Solution
Intuition \nThis is basically a simulation problem. It does not involve any DSA - just keeping in mind constraints and knowing string iteration should work.\n\n
# Intuition \nThis is basically a simulation problem. It does not involve any DSA - just keeping in mind constraints and knowing string iteration should work.\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1) externally, O(N) for internal stack\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int mins = targetSeconds/60;\n        int secs = targetSeconds % 60;\n\n        while (mins > 99) {\n            mins--;\n            secs += 60;\n        }\n\n        int min = Integer.MAX_VALUE;\n        while (secs <= 99) {\n            String time = Integer.toString(mins) + String.format("%02d", secs);\n            time = time.replaceAll("^0+(?!$)", "");\n            min = Math.min(\n                    min,\n                    helper(startAt, moveCost, pushCost, time, 0, time.length(), 0)\n                );\n            mins--;\n            secs += 60;\n        }\n        return min;\n    }\n\n    private int helper(int ch, int move, int push, String time, int curr, int N, int cost) {\n        if (curr >= N) {\n            return cost;\n        }\n\n        int digit = time.charAt(curr)-\'0\';\n        if (ch == digit) {\n            return helper(ch, move, push, time, curr+1, N, cost+push);\n        } else {\n            return helper(digit, move, push, time, curr+1, N, cost+move+push);\n        }\n    }\n}\n```
['Simulation', 'Java']