Problem 1920 · Easy

Build Array from Permutation

Build a new array where each position holds the original permutation value at the index given by that position. The visual draws arrows from each index to the value it points to, forming chains of lookups.

Open the interactive visualisation