• + 0 comments
    public static int saveThePrisoner(int n, int m, int s) {
        return (((((m % n) + (s - 1)) % n) + (n - 1)) % n) + 1;
    }