Build Array From Permutation Leetcode