This was an exercise for NSS C#/.Net backend.
At some point there was a war, and during one of its battles defendants were blocked by attackers in the cave. To avoid capture they decided to stand in a circle and kill each third until only one person remained. That person was supposed to commit suicide. He eventually decided to just surrender. Apparently this is a real thing that happened and the guy's name was Josephus.
Your task is to write a method called LastPersonStanding
that, for a given number of people numberOfPeople
and killing interval killingInterval
, determines the position of the person who remains alive... the Josephus position.