problem 004 solution