Minh Hieu Posted on Sep 20, 2020 • Edited on Sep 20, 2020 Save the Prisoner Explain Solution | Javascript #hackerrank function saveThePrisoner(n, m, s) { console.log((m-1 + s) % n) return (m-1 + s)%n || n; } saveThePrisoner(3, 1, 2); Problem Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)