Algorithms practice and solutions