Generate all possible ways and calculate cost. Simple, Easy to understand. Beats 100%.
Code

# Code
```cpp []
class Solution {
public:
    int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {
        vector<string> ways;
        int minutes = targetSeconds / 60;
        int seconds = targetSeconds % 60;
        if (minutes < 100) ways.push_back(to_string(minutes*100 + seconds));
        if (seconds < 40) ways.push_back(to_string((minutes-1)*100 + seconds + 60));
        
        int minCost = INT_MAX;
        for (string way : ways) {
            int cost = way.length() * (pushCost + moveCost);
            char currPos = '0' + startAt;
            for (char ch : way) {
                if (ch == currPos) cost -= moveCost;
                currPos = ch;
            }
            minCost = min(minCost, cost);
        }
        return minCost;
    }
};
```
['C++']