This problem is an exercise in the implementation of queue.  We will look at the implementation of a circular array.  Then we will use the implementation to solve a problem called the Josephus problem. Josephus Flavius was a famous historian of the first century at the time of the Second Temple destruction.  During the war he got trapped in a cave with a group of 39 soldiers surrounded by Romans.  The legend has it that preferring suicide to capture, the people decided to form a circle and, proceeding clockwise around it, to kill every seventh(It will be given as an input) person until only one was left, who must then commit suicide.  Josephus, an accomplished mathematician, quickly found the safe spot in the circle (24th) to be the last to go.  But when the time came, instead of killing himself he joined the Roman side.  The problem rightfully raises the question of how someone might be able to quickly compute the correct place to stand.