Java. Only two options. Clean code. 0ms
What a weird question.\nOnly two options:\n\n\t1. (minute, second)\n\t2. (minute - 1, second + 60)\n\nRemember to check boundary. Also, only press 0 when there 
What a weird question.\nOnly two options:\n\n\t1. (minute, second)\n\t2. (minute - 1, second + 60)\n\nRemember to check boundary. Also, only press 0 when there is **any** previous number that is not 0.\n\t\n```Java\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int m = targetSeconds / 60;\n        int s = targetSeconds % 60;\n        int one = find(startAt, moveCost, pushCost, m, s);\n        int two = find(startAt, moveCost, pushCost, m - 1, s + 60);\n        if (s >= 40 || m == 0) return one;\n        if (m >  99) return two;\n        return Math.min(one, two);\n    }\n\n    private int find(int i, int c, int p, int m, int s){\n        int ans = 0;\n        int[] data = new int[]{0, i}; //prev key sum, prev key\n        ans += each(c, p, m / 10, data);\n        ans += each(c, p, m % 10, data);\n        ans += each(c, p, s / 10, data);\n        ans += each(c, p, s % 10, data);\n        return ans;\n    }\n\n    private int each(int c, int p, int key, int[] data){\n        data[0] += key;\n        if (data[0] == 0) return 0;\n        int ans = (data[1] == key? p : p + c);\n        data[1] = key;\n        return ans;\n    }\n}\t\n```
['Java']