Two Stack Problem Leetcode Javascript Solution