✅ C++ || Easy || Readable || Short Code
2 possible time settings, compare cost of both\n1. Minutes = time/60 , seconds = time%60\n2. Minutes = time/60 - 1 , seconds = time%60 + 60\n\nNote :  Also chec
### 2 possible time settings, compare cost of both\n1. Minutes = time/60 , seconds = time%60\n2. Minutes = time/60 - 1 , seconds = time%60 + 60\n\nNote :  Also check if minutes and seconds are in the display range i.e. [1,99]\n\n```\nclass Solution {\n    int s,m,p,t;\n    \n    int computeCost(int &Min,int &sec){\n        string a1 = (Min>0) ? to_string(Min) : "";\n        if(sec <= 9 && Min != 0) a1 += "0" + to_string(sec);\n        else a1 += to_string(sec);\n        \n        int cost = ((a1[0]-\'0\') != s) ? m : 0;\n        int i = 0;\n        while(i < a1.size()){\n            cost += p;\n            if(i>0 && a1[i-1] != a1[i]) cost += m;\n            i++;\n        }\n        return cost;\n    }\n    \npublic:\n    int minCostSetTime(int start, int move, int push, int time) {\n        s = start , m = move, p = push , t = time;\n        int M = t/60 , S = t%60 , cost = INT_MAX;\n        for(int i = -1 ; i<=0 ; i++){\n            int Min = M+i , sec = S -60*i;\n            if(Min<0 || Min>99 || sec>99 || sec<0) continue;\n            cost = min(cost , computeCost(Min,sec));\n        }\n        return cost;\n    }\n};\n```
['String', 'C']