[Adding Complete Solution]