Created
May 24, 2022 08:28
-
-
Save rachidelaid/dc2a64acfe0f0117c597b45f861e12f9 to your computer and use it in GitHub Desktop.
this is the solution for a hackerrank problem https://www.hackerrank.com/challenges/save-the-prisoner/problem?isFullScreen=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function saveThePrisoner(n, m, s) { | |
return (m%n+s-1)%n ? (m%n+s-1)%n : n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment