Solving first set of problems on lists