Nearest Smaller Element Leetcode Python Beginner