Exact Solutions of Melting and Solidification Problems