JAVA Solution ||(Brute Force)|| All Edge Cases Explained !!!
Brute Force Solution\n0(1)Time And Space Complexity\n*\n\tclass Solution {\n\t\tpublic int minCostSetTime(int startAt, int moveCost, int pushCost, int ts) \n\t\
Brute Force Solution\n0(1)Time And Space Complexity\n****\n\tclass Solution {\n\t\tpublic int minCostSetTime(int startAt, int moveCost, int pushCost, int ts) \n\t\t{\n\t\t\tchar st=(char)(startAt+\'0\');\n\t\t\tif(ts<60)\n\t\t\t\treturn cost(st,ts+"",moveCost,pushCost);\n\t\t\telse\n\t\t\t{\n\t\t\t\tint min=ts/60;\n\t\t\t\tint sec=ts%60;\n\t\t\t\tString s1="",s2="",or="";\n\t\t\t\t\n\t\t\t\tif(ts<=99)\n\t\t\t\t\tor=ts+"";  // Orignal time in second;\n\n\t\t\t\tif(min==100)  //If time >=100 min than convert in 00:99 second format\n\t\t\t\t{\n\t\t\t\t\tmin--;\n\t\t\t\t\tsec+=60;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(sec<10)\n\t\t\t\t{\n\t\t\t\t\ts1=min+"0"+sec;  //Time in 60 second format\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ts1=min+""+sec;\n\t\t\t\t}\n\n\t\t\t\tif(sec<=39)\n\t\t\t\t{\n\t\t\t\t\tmin--;\n\t\t\t\t\tsec+=60;\n\t\t\t\t\ts2=min+""+sec;  //If time can be represened in 00:99 seconds Format\n\t\t\t\t}\n\n\t\t\tint ans=Math.min(cost(st,or,moveCost,pushCost),Math.min(cost(st,s1,moveCost,pushCost),cost(st,s2,moveCost,pushCost)));\n\t\t\t\treturn ans;\n\t\t\t}  \n\t\t}\n\n\t\tpublic int cost(char st,String s,int moveCost, int pushCost)\n\t\t{\n\t\t\tif(s.length()==0)\n\t\t\t\treturn Integer.MAX_VALUE;\n\n\t\t\tint push=s.length();\n\t\t\tint move=1;\n\t\t\tfor(int i=0;i<push-1;i++)\n\t\t\t{\n\t\t\t\tif(s.charAt(i)!=s.charAt(i+1))\n\t\t\t\t{\n\t\t\t\t\tmove++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(st==s.charAt(0))\n\t\t\t\tmove--;\n\n\t\t\treturn (move*moveCost)+(push*pushCost);    \n\t\t}\n\t}\n\t****
['Java']