Josephus Oct 30, 2019 // the last one left in the list public int josephus(int n, int k) { int s = 0; for (int i = 2; i <= n; i++) s = (s + k) % i; return s; } Please enable JavaScript to view the comments powered by Disqus.