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