def permutationEquation(p):
# Write your code here
result = [0] * len(p)
for n in p:
next_ = p[n - 1]
next__ = p[next_ - 1]
result[next__ - 1] = n
return result
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Find Digits (0) | 2022.07.30 |
---|---|
[HackerRank-python] Jumping on the Clouds: Revisited (0) | 2022.07.28 |
[HackerRank-python] Circular Array Rotation (0) | 2022.07.27 |
[HackerRank-python] Save the Prisoner! (0) | 2022.07.27 |
[HackerRank-python] Viral Advertising (0) | 2022.07.26 |