Two Stack Problem Leetcode Javascript Questions