You are viewing a single comment's thread. Return to all comments →
Typescript -- time complexity O(1)!
function solve(n: number): string { const moves = (Math.sqrt(8 * n + 1) - 1) / 2; return Number.isInteger(moves) ? 'Go On Bob ' + moves : 'Better Luck Next Time'; }
Seems like cookies are disabled on this browser, please enable them to open this website
Stepping Stones Game
You are viewing a single comment's thread. Return to all comments →
Typescript -- time complexity O(1)!