implemented 2 list problems from leetcode