Build An Array With Stack Operations Leetcode