Ad
  • Default User Avatar

    Hi,

    I need your help with one test case:

    Test.assert_equals(josephus([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],40),[10, 7, 8, 13, 5, 4, 12, 11, 3, 15, 14, 9, 1, 6, 2], "Should work for larger ks too")

    I am getting an "IndexError: pop index out of range", when the value of 'K' exceeds the count of elements in the source list. Is having 'K' (ie: more people to kill) than the number of items (ie: the people to kill), a valid scenario?