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
Save the Prisoner!
You are viewing a single comment's thread. Return to all comments →
Perl: