Add sol problem 40