Java solution
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    /**\n        Idea is to first define helper fn that calculates total cost to set time in mm:ss.\n        This would be of the form mm * 100 + ss.\n        Then we need to find out all valid mm:ss for targetSeconds.\n        This we can do by iterating mm from 0 to targetSeconds/60. Leftover would be ss.\n     */\n     \n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        List<int[]> possibleMMSS = possibleMMSS(targetSeconds);\n        long minCost = Long.MAX_VALUE;\n        for (int[] mmss : possibleMMSS) {\n            int mm = mmss[0];\n            int ss = mmss[1];\n            minCost = Math.min(minCost, findCost(mm, ss, startAt, moveCost, pushCost));\n        }\n        return (int) minCost;\n    }\n\n    private List<int[]> possibleMMSS(int targetSeconds) {\n        List<int[]> possibleMMSS = new ArrayList<>();\n        for (int minute = 0; minute <= 99; minute++) {\n            int seconds = targetSeconds - (minute * 60);\n            if (seconds > 99) {\n                continue;\n            }\n            if (seconds < 0) {\n                break;\n            }\n            possibleMMSS.add(new int[]{minute, seconds});\n        }\n        return possibleMMSS;\n    }\n\n    private long findCost(int mm, int ss, int startAt, int moveCost, int pushCost) {\n        String time = String.valueOf(mm * 100 + ss);\n\n        long totalCost = 0;\n        char startAtCh = (char) (startAt + \'0\');\n        for (int i = 0; i < time.length(); i++) {\n            char ch = time.charAt(i);\n\n            if (ch != startAtCh) {\n                totalCost += moveCost;\n                startAtCh = ch;\n            }\n\n            totalCost += pushCost;\n        }\n\n        return totalCost;\n    }\n}\n```
['Java']