Java simple
```\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int min = targetSeconds / 60;\n     
```\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int min = targetSeconds / 60;\n        int sec = targetSeconds % 60;\n        long out = Long.MAX_VALUE;\n        if(min < 100)\n            out = Math.min(out, getCost(startAt, moveCost, pushCost, min * 100 + sec)); \n        if(sec < 40 && min > 0){\n            out = Math.min(out, getCost(startAt, moveCost, pushCost, (min-1) *100 + (sec + 60)));\n        }\n        return (int)out;\n    }\n    \n    private long getCost(int n, int moveCost, int pushCost, int x){\n        long sum = 0;\n    \tfor(int i=1;i<4;i++) {\n    \t\tint d = (int)Math.pow(10, i);\n    \t\tif(x / d == 0) {\n    \t\t\tx %= d;\n    \t\t}else {\n    \t\t\tbreak;\n    \t\t}\n    \t}\n    \tString s = String.valueOf(x);\n    \tfor(char c : s.toCharArray()) {\n    \t\tint e = c-\'0\';\n    \t\tif(e != n) {\n    \t\t\tsum += moveCost + pushCost;\n    \t\t}else {\n    \t\t\tsum += pushCost;\n    \t\t}\n    \t\tn = e;\n    \t}\n        return sum;\n    }\n}
[]