You are viewing a single comment's thread. Return to all comments →
My TypeScript solution:
function saveThePrisoner(n: number, m: number, s: number): number { const lastPrisioner: number = (s - 1 + m) % n; return lastPrisioner == 0 ? n : lastPrisioner; }
Seems like cookies are disabled on this browser, please enable them to open this website
Save the Prisoner!
You are viewing a single comment's thread. Return to all comments →
My TypeScript solution: