Please take a look on the following explanation and solution.