add two dynamic programming solutions