solution in python for problems on leetcode