Problem 040 solution.
Problem 041 solution.