Please give the solution. I couldn't understand how the answer is got.