common dynamic programming problems