Add statement to problem 40
Add some tests to problem 40
Update tests to match with problem statement
Add iterative solution to problem 40
Refactor algorithm to validate input data before to start with the algorithm