JS
Code\n\nvar minCostSetTime = function (startAt, moveCost, pushCost, targetSeconds) {\n    let min = Math.trunc(targetSeconds / 60)\n    let sec = targetSeconds 
# Code\n```\nvar minCostSetTime = function (startAt, moveCost, pushCost, targetSeconds) {\n    let min = Math.trunc(targetSeconds / 60)\n    let sec = targetSeconds % 60\n    let minRes = Infinity\n    if (min <= 99) check(min, sec)\n    if (min > 0 && sec <= 39 && min <= 100) check(min - 1, sec + 60)\n    return minRes\n\n    function check(min, sec) {\n        let str = (min === 0 ? "" : String(min)) + (min === 0 ? String(sec) : String(sec).padStart(2, \'0\'))\n        let currentRes = 0\n        let newStart = startAt\n        for (let i = 0; i < str.length; i++) {\n            if (newStart != str[i]) {\n                newStart = +str[i]\n                currentRes += moveCost\n            }\n            currentRes += pushCost\n        }\n        minRes = Math.min(currentRes, minRes)\n    }\n};\n```
['JavaScript']