Solved problem 1
solved problem 2
Solving problem 3