Typescript/Javascript solution
Simple, but tons of corner cases. :/\nI send wrong solutions 3 times during contest... All in all -- love this problem :)\n\n\nfunction minCostSetTime(\n    sta
Simple, but tons of corner cases. :/\nI send wrong solutions 3 times during contest... All in all -- love this problem :)\n\n```\nfunction minCostSetTime(\n    startAt: number,\n    moveCost: number,\n    pushCost: number,\n    targetSeconds: number,\n): number {\n    const mins = Math.floor(targetSeconds / 60);\n    const seconds = targetSeconds % 60;\n    const options = [\n        `${\n            mins > 0 ? mins : \'\' // avoid \'0\'\n         }${\n            `${seconds}`.padStart(mins > 0 ? 2 : 0, \'0\') // avoid "12" for 1 minutes 2 seconds AND \'01\' for 0 minutes 1 seconds\n         }`\n    ];\n    \n    if (targetSeconds > 59 && (seconds + 60 <= 99)) { // remember: we can dial 1 minute 30 seconds as "160" OR "90" as long as seconds are below 99\n        options.push(`${\n            (mins - 1) > 0 ? mins - 1 : \'\' // once again avoid "0"\n        }${\n            seconds + 60 // no need to check here, since we know that number is double digits\n        }`);\n    }\n    \n    let minSum = Infinity;\n\n    for (const option of options) {\n        if (option.length > 4) continue; // will ensure that we only accept 100 minutes 00 seconds as 9960 :/\n        let optionSum = 0;\n        let current = `${startAt}`;\n        for (let i = 0; i < option.length; i++) {\n            const n = option[i];\n            if (n !== current) {\n                optionSum += moveCost;\n                current = n;\n            }\n            optionSum += pushCost;\n        }\n        if (optionSum < minSum) {\n            minSum = optionSum;\n        }\n    }\n    return minSum;\n};\n```
['TypeScript', 'JavaScript']