Your question is Random Sorting Algorithm. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Intelligent Medical Objects may need to vary the display order of terminology candidates so that a fixed input order does not introduce presentation bias. Given a list of numbers representing candidate scores, return a new list containing the same values in a uniformly random order.
Use a supplied integer seed so the result is reproducible for testing. Implement the shuffle with the Fisher-Yates algorithm. Do not modify the input list.
Implement shuffle_numbers(nums, seed). The parameter nums is a list of integers, and seed is an integer. Return a new list containing exactly the same elements as nums, in a permutation determined by seed.
Use Python's random.Random(seed) as the pseudorandom generator. At position i, choose the swap index uniformly from 0 through i, inclusive. The algorithm must not use random.shuffle directly.
def shuffle_numbers(nums, seed):