Next Smaller Element Leetcode Javascript Questions