Write a function inversePermutation to which a list of integers must be passed as argument. This list must represent a permutation of the numbers 1 to $$n$$, where $$n$$ is equal to the length of the list. The function must return a new list as a result, which represents the inverse permutation.
Use the inversePermutation function to write a function ambiguousPermutation. To this function, a list of integers must be passed as an argument, which is a permutation of the numbers 1 to $$n$$ (with $$n$$ equalling the length of the list). The function must return a Boolean value as a result, which indicates whether the given list is ambiguous or not.
>>> inversePermutation([1, 4, 3, 2])
[1, 4, 3, 2]
>>> inversePermutation([2, 3, 4, 5, 1])
[5, 1, 2, 3, 4]
>>> inversePermutation([1])
[1]
>>> ambiguousPermutation([1, 4, 3, 2])
True
>>> ambiguousPermutation([2, 3, 4, 5, 1])
False
>>> ambiguousPermutation([1])
True