InPlace.Examples.Josephus (inplace v0.7.1)

Copy Markdown

https://en.wikipedia.org/wiki/Josephus_problem

Summary

Functions

Form the circle from N soldiers. Going clockwise, eliminate every k-th soldier until only one soldier is left.

Functions

solve(num_soldiers, every_k)

Form the circle from N soldiers. Going clockwise, eliminate every k-th soldier until only one soldier is left.