1920. Build Array from Permutation
Given a zero-based permutation
nums(0-indexed), build an arrayansof the same length whereans[i] = nums[nums[i]]for each0 <= i < nums.lengthand return it.A zero-based permutation
numsis an array of distinct integers from0tonums.length - 1(inclusive).
1 | class Solution { |