✅ C++ | All Combination | Simple | Easy | Readable
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 {\npublic:\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        \n        int mm1=targetSeconds;\n        int ss1=0;\n        mm1=mm1/60;\n        ss1=targetSeconds%60;\n        \n        int mm2=-1,ss2=-1;\n        \n        if(ss1<=39){\n            mm2=mm1-1;\n            ss2=ss1+60;\n        }\n\n//\t\tcout<<mm2<<" "<<ss2<<endl;\n\n\t\t\n        \n        int sum1=INT_MAX;\n        int sum2=INT_MAX;\n\n        if(mm1<=99){\n            string s1="";\n            if(ss1<10){\n                s1=to_string(mm1)+\'0\'+to_string(ss1);\n            }\n            else{\n                s1=to_string(mm1)+to_string(ss1);\n            }\n\n            string t1="";\n            int flag=1;\n            for(int i=0;i<s1.length();i++){\n                if(flag==0){\n                    t1=t1+s1[i];\n                }\n                if(flag==1 && s1[i]!=\'0\'){\n                    flag=0;\n                    t1=t1+s1[i];\n                }\n            }\n            \n            \n    //\t\tcout<<t1<<endl;\n            \n\n            sum1=0;\n            if(int(t1[0]-48)==startAt){\n                sum1=sum1+pushCost;\n            }\n            else{\n                sum1=sum1+pushCost+moveCost;\n            }\n            for(int i=1;i<t1.length();i++){\n                if(t1[i]==t1[i-1]){\n                    sum1=sum1+pushCost;\n                }\n                else{\n                    sum1=sum1+pushCost+moveCost;\n                }\n            }\n        }\n\n\n        if(mm2!=-1){\n            sum2=0;\n            string s2=to_string(mm2)+to_string(ss2);\n\t\t\tstring t2="";\n\t\t\tint flag=1;\n\t\t\tfor(int i=0;i<s2.length();i++){\n\t\t\t\tif(flag==0){\n\t\t\t\t\tt2=t2+s2[i];\n\t\t\t\t}\n\t\t\t\tif(flag==1 && s2[i]!=\'0\'){\n\t\t\t\t\tflag=0;\n\t\t\t\t\tt2=t2+s2[i];\n\t\t\t\t}\n\t\t\t}\n//\t\t\tcout<<t2<<endl;\n            if(int(t2[0]-48)==startAt){\n                sum2=sum2+pushCost;\n            }\n\t\t\telse{\n\t\t\t\tsum2=sum2+pushCost+moveCost;\n\t\t\t}\n            for(int i=1;i<t2.length();i++){\n                if(t2[i]==t2[i-1]){\n                    sum2=sum2+pushCost;\n                }\n                else{\n                    sum2=sum2+pushCost+moveCost;\n                }\n            }\n            \n        }\n\n        cout<<sum1<<" "<<sum2;\n\n        return min(sum1,sum2);\n        \n    }\n};\n```
['C++']