Add statement to problem 39
Add some tests to problem 39
Add iterative solution to problem 39