You are viewing a single comment's thread. Return to all comments →
Perl:
sub saveThePrisoner { my ($n, $m, $s) = @_; return ($s + $m - 1) % $n == 0 ? $n : ($s + $m - 1) % $n; }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Save the Prisoner!
You are viewing a single comment's thread. Return to all comments →
Perl: