Explained the final solution in full detail.

Added text formatting (bold section headings).