You are viewing a single comment's thread. Return to all comments →
My solution in Rust:
pub fn save_the_prisoner(n: i32, m: i32, s: i32) -> i32 { let res; if m > n { res = m % n + s - 1; } else { res = m + s - 1; } if res == 0 { return n } if res > n { return res - n; } return res; }
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 →
My solution in Rust: