Build Array From Permutation Leetcode 46