C# | Evaluate all possible mins and seconds combination for target
\npublic class Solution {\n    public int MinCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int mins = targetSeconds/60;\n  
```\npublic class Solution {\n    public int MinCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int mins = targetSeconds/60;\n        int sec = targetSeconds%60;\n        int ans = int.MaxValue;\n        if(mins>99){\n            sec=targetSeconds-5940;\n            mins=99;\n        }\n    \n        while(sec<100 && mins>=0){\n            ans = Math.Min(ans,Calculate(mins,sec,startAt,moveCost,pushCost));\n            mins--;\n            sec+=60;\n        }\n        return ans;\n        \n    }\n    public int Calculate(int mins,int sec,int startAt, int moveCost, int pushCost){\n        char prev = startAt.ToString()[0];\n        string ssec = sec<10 && mins>0 ? "0"+sec : sec.ToString();\n        string smins = mins.ToString();\n        int ans=0;\n        if(mins>0){\n            for(int i=0;i<smins.Length;i++){\n              if(prev!=smins[i]) ans+=moveCost;\n              prev = smins[i];\n             ans+=pushCost;\n            }\n        }\n        for(int i=0;i<ssec.Length;i++){\n            if(prev!=ssec[i]) ans+=moveCost;\n            prev = ssec[i];\n            ans+=pushCost;\n        }\n        return ans;\n    }\n}\n```
[]