Next Smaller Element Leetcode Practice Python