Python Solution for LeetCode Problems