Simple c++ with explanation | faster than 100% | TC: O(1), SC: O(1)
Intuition\nAfter looking at few examples it can be easily seen that there will be broadly two possible cases. And we will calculate cost of these two cases and 
# Intuition\nAfter looking at few examples it can be easily seen that there will be broadly two possible cases. And we will calculate cost of these two cases and find the minimum of the two. \n\n1. Split our seconds to `mm:ss` -> Do this in a strict way  \n2. If we can add few more seconds to `:ss` part  \n\nFor 1st case we just need to calculate how many minutes are there in targetSeconds, and what is the remaining number of seconds. (This is our case-1, but we also need to make sure that minutes does not exceed 99 minutes)\n\nFor 2nd case, we need to check if we can add one extra minute (60 seconds) to our current remaining seconds (it should not exceed 99 seconds). \n\nOther than these we will not worry about prepending zeros since there is no cost associated with it. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n# Code\n```\nclass Solution {\npublic:\n    // Used to calculate the cost to reach from startAt -> val (by updating startAt to val)\n    int findCost(int &startAt,int moveCost,int pushCost,int val){\n        int ans = 0;\n        if(startAt!=val){\n            ans+=moveCost;\n        }\n        ans+=pushCost;\n        startAt = val;\n        return ans;\n    }\n\n    // Find cost to reach given minute and second. \n    int findMinCost(int startAt,int moveCost,int pushCost,int min,int sec){\n        if(min==0 && sec==0) return 0;\n        int ans = 0;\n        int m0 = min%10, m1 = min/10, s0 = sec%10, s1 = sec/10;\n        // This array helps in avoiding prepending zeros calculation\n        vector <int> time = {m1,m0,s1,s0};\n        \n        int ind = 0;\n        while(ind<4 && time[ind]==0) ind++;\n        for(int i=ind;i<4;i++){\n            ans+=findCost(startAt,moveCost,pushCost,time[i]);\n        }\n        return ans;\n    }\n\n    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int min1 = targetSeconds/60;\n        int sec1 = targetSeconds%60;\n        \n        int min2 = -1, sec2=-1;\n        if(min1 >=1 && sec1+60 <=99){\n            min2 = min1-1;\n            sec2 = sec1+60;\n        }\n\n        int ans = INT_MAX;\n        if(min1<100)\n            ans = findMinCost(startAt,moveCost,pushCost,min1,sec1);\n        if(min2!=-1)\n            ans = min(ans,findMinCost(startAt,moveCost,pushCost,min2,sec2));\n        return ans;\n    }\n};\n```
['C++']