Correct answer for problem 2