Problem1 - code to solve the first problem.