Nearest Smallest Element Leetcode Problem