Try this approach to solve the 'Build Array from Permutation' Leetcode Problem no. 1920.

Published --