Given n people, find the survivor. Starting from the first person, they kill the person to their left and the next surviving person kills the person to their left. This keeps happening until 1 person survives. Return that person's number.
josephus(1) ➞ 1
josephus(8) ➞ 1
josephus(41) ➞ 19
You can search up the problem if you are too confused about the instructions.