Short (Explained solution): Loop Through each possible combination  O(1) time/space
Since there were many possible ways to write the number and that would have been a tedious task to find all so simply check all the possible combinations you ca
Since there were many possible ways to write the number and that would have been a tedious task to find all so simply check all the possible combinations you can put on microwave \n\n* The crux was to check all the possible ways from 0001 to 9999 \n* If you find the number of seconds equal to target seconds.\n* Count how many energy  you need to  make this possible combination.\n\n```\nclass Solution {\npublic:\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) \n    {\n    int ans=INT_MAX;\n    for(int i=1;i<=9999;i++)\n    {\n        int seconds=((i/100)*60)+(i%100);// count number of seconds\n    \n        if(seconds!=targetSeconds)// check whether no. of  seconds are equal to target seconds or not\n            continue;\n        \n        int start=startAt,count=0,j=0;// start time \n        string s=to_string(i); // i converted the  combination to string so that i can loop through it easily \n        while(j<s.size()) // part where i calculated the number of points\n        {\n            if(s[j]!=start+\'0\') // if start position is not thedesired position\n                count+=moveCost+pushCost;\n            else\n                count+=pushCost;  \n            start=s[j++]-\'0\';  // change the start position\n        }\n        ans=min(ans,count);   \n    }\n       \n        return ans;\n    }\n};\n```
['Greedy', 'Simulation']