add tests and solution for problem 32