Next Smaller Element Leetcode Practice Java