Algorithms practice and problems solutions