• Can't run test cases

Question related to mission Reversed Permutation Index

 

I believe my code is correct, but when I check it against the test cases I get this, 'ErrorProcessOutOfSystemLimits' I suspect this is because of the large numbers and large number of iterations. Does anyone know what I could be doing wrong or how I can work around this?

Here is my code:

numbers=[]

for x in range(0,length):

  numbers.append(x)

return list(itertools.permutations(numbers))[index-1]