Difiiculty in understanding question's solution

This is the question

here is the solution