Updated the solution of Question 21

Updated the solution of Question 21