LeetCode solutions in Python 3