You are viewing a single comment's thread. Return to all comments →
int saveThePrisoner(int n, int m, int s) { int result = ((m % n) + (s - 1)) % n; return result == 0 ? n : result; }
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 →