Pulsars
0 %
Log inSign up

Returning the last p survivors

Open answer

Modify the previous function so that it takes an integer p as a parameter, equal to the number of survivors wanted, and returns as a list the positions of the last p survivors. Then apply it to the Josephus problem with two survivors: where should Josephus and his friend have stood? (Question I.2 of the assignment.)