Solve Josephus Problem with zipper