Easy to understand Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. We will firstly find
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. We will firstly find all the possible ways or combinations.\n2. Secondly we will find the minCost by traversing over each combination.\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```cpp []\nclass Solution {\npublic:\n    vector<string> allPossible(int targetSeconds) {\n        vector<string> possibles;\n        for (int min = 0; min <= 99; min++) {\n            int targetSum = targetSeconds;\n            int sec = 0;\n            targetSum -= (min * 60);\n            if(targetSum < 0) break ;\n            if (targetSum >= 0 && targetSum <= 99) {\n                sec = targetSum;\n                targetSum -= sec;\n            }\n            if (targetSum == 0) {\n                string a = to_string(min);\n                string b = sec > 9 ? to_string(sec) : "0" + to_string(sec);\n                possibles.push_back(a + b);\n            }\n        }\n        return possibles;\n    }\n    int minCostSetTime(int startAt, int moveCost, int pushCost,\n                       int targetSeconds) {\n        vector<string> ans = allPossible(targetSeconds);\n        int minCost = INT_MAX;\n        for (auto s : ans) {\n            int i = 0;\n            int cost = 0;\n            // remove the leading zero\n            int num = stoi(s);\n            s = to_string(num);\n            while(i < s.length()){\n                int n = s[i] - \'0\';\n                // check whether it matches with the startAt \n                if(n == startAt && i == 0){\n                    if(n != 0){\n                        // push it \n                        cost += pushCost;\n                    }\n                    // move forwar \n                    if(i + 1 < s.length() && s[i] != s[i + 1]) cost += moveCost;\n                    i++;\n                }else{\n                    if(i == 0){\n                        // i have to move\n                        cost += moveCost;\n                    }\n                    cost += pushCost;\n                    if(i + 1< s.length() && s[i] != s[i + 1]) cost += moveCost;\n                    i++;\n                }\n            }\n            minCost = min(cost, minCost);\n        }\n        return minCost;\n    }\n};\n```
['C++']