Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 409 Bytes

README.md

File metadata and controls

9 lines (6 loc) · 409 Bytes

JosephusProblem-iOS

My solution to a variation of the Josephus problem (see below).

K = 2 (the count of each step). N can be entered by the user.

The process begins with removing the first person, skipping the second, removing the third, skipping the fourth, and on and on in a circular fashion until only one person remains. The number of the chair the person was sitting in is displayed as the result.