Given a 0-indexed integer array nums which is a permutation of the first n natural numbers, return an array ans of the same length as nums such that ans[i] = nums[nums[i]] for each 0 <= i < ...
when i = n, i.e. when a permutation has been formed; aux is an auxiliary array, that keeps track which numbers are already in the permutation, such that they do not repeat.*/ while ( j <= n ) { // ...