Received the following and was quite out of clue on how to solve it.
-
Standing in a circle is a group of n people in a clockwise order where each person is labeled 1 to n.
-
Starting at the 1st person we count the next k workers in the circle, not including the one we start at. The counting wraps around the circle and you may count persons more than once..
-
The person you land at gets assassinated and is then removed from the circle.
-
Starting from the next person clockwise from the one you just removed, repeat steps until you have n/2 persons left. You should always round up when calculating n/2. For example if you have five workers then two get to go home.
Return the order as a list in which the persons are assassinated. One person is always left.
This is a start but I couldn't implement the n/2 part
def circle(n, k):
p, i, seq = list(range(n)), 0, []
while p:
i = (i+k-1) % len(p)
seq.append(p.pop(i))
return seq

