Java Solution || With example and comments
We have 2 option. \n1. minutes:seconds\n2. minutes-1:60+seconds\nFor Exmaple\n10:00 can be represented as \n10:00 or 9:60\nWe then convert to microve time by mu
We have 2 option. \n1. minutes:seconds\n2. minutes-1:60+seconds\nFor Exmaple\n10:00 can be represented as \n10:00 or 9:60\nWe then convert to microve time by multiplying 100 to minutes\n```\n10:00-> 10*100+0 = 1000\n9:60--> 9*100+60 = 960\n```\n\n\n```\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int minutes = targetSeconds/60;//Convert targetseconds to minutes and seconds\n        int seconds = targetSeconds%60;\n        //We have 2 option\n        return Math.min(findMinCost(startAt,moveCost,pushCost,minutes,seconds),\n                        findMinCost(startAt,moveCost,pushCost,minutes-1,60+seconds));\n    }\n    public int findMinCost(int startAt, int moveCost, int pushCost, int minutes, int seconds){\n        if(seconds< 0 || minutes<0 || minutes>99 || seconds>99){\n            return Integer.MAX_VALUE;\n        }\n        int minCost = 0;\n        int microwaveTime = (minutes*100)+seconds;//So avoid leading zeros 6:10 --->610\n        char digits[] = String.valueOf(microwaveTime).toCharArray();\n        for(char digitChar : digits){\n            int digit = digitChar -\'0\';\n            minCost = minCost+ pushCost + (startAt==digit?0:moveCost);//if the current digit is different then previous one we need to add a move cost since we move to a different position\n            startAt = digit;\n        }\n        return minCost;\n    }\n}\n```
['Java']