Add solution to problem 15.

The solution use principle of dp.