Next Smaller Element Leetcode Python