Previous Greater Element Leetcode Python Solutions