about | help | code help+videos | done | prefs |
Given a List of people (integers) numbered starting with 1, and a skip number "s", return a list containing the final spot that will be surviving at index 0 and the second to last person eliminated at index 1 if they play the Josephus elimination game. Copy your solution from list_josephusSolver and then modify it to return a list of integers with the two answers instead of just the integer index of the final spot. list_josephusBonus([1, 2], 2) → [1, 2] list_josephusBonus([1, 2, 3], 2) → [3, 1] list_josephusBonus([1, 2, 3, 4], 2) → [1, 3] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy