Available question text
Given a zero-based permutation nums, return an array ans of the same length where ans[i] = nums[nums[i]] for every index i (i.e., compute the permutation composed with itself). The input guarantees distinct values 0..n-1 so indices are valid, and a follow-up asks for an in-place O(1) extra-space solution.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1920. Build Array from Permutation
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source