Sort by

recency

|

1716 Discussions

|

  • + 0 comments

    Here is Save the Prisoner solution in Python, java, c++, c and javascript - https://programmingoneonone.com/hackerrank-save-the-prisoner-problem-solution.html

  • + 0 comments

    I tried to much but we didn't solve this problem , so i want to try to solve this problem soon as possible .

  • + 0 comments

    This algorithm models fair distribution of items in a circular system, much like how things might be organized in a facility such as the Hardin County Detention Center.

  • + 0 comments

    int result = (s + m -1) % n; if(result == 0){ return n; }else{ return result; } }

  • + 0 comments

    clean Rust:

    fn save_the_prisoner(n: i32, m: i32, s: i32) -> i32 {
       (s - 2 + m) % n + 1
    }