You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Link: https://www.hackerrank.com/challenges/permutation-equation/problem
'''
def permutationEquation(p):
'''
This was tricky as INDEXES were supposed to be treated as VALUES in step 1 and then those VALUES are treated as INDEXES in step 2. Quite Interesting!
So, we just loop in the LEN of LIST and for each INDEX NUMBER, we increament 1 as we have to fetch that number. Now we get an index and we have to increament that index, treat it as value in next step and then again find the increamented index.