You are viewing a single comment's thread. Return to all comments →
Java one line cryptic solution:
public static int saveThePrisoner(int n, int m, int 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 →
Java one line cryptic solution: