Improve solution and doc.