3 ms·
Lots of project Euler problems have dp solutions. Try http://projecteuler.net/index.php?section=problems&id=215 http://projecteuler.net/index.php?section=probl
by btilly 16y ago
Lots of project Euler problems have dp solutions. Try http://projecteuler.net/index.php?section=problems&id=215 http://projecteuler.net/index.php?section=problems&id=21... for a fairly easy one, or http://projecteuler.net/index.php?section=problems&id=201 http://projecteuler.net/index.php?section=problems&id=20... for a harder one.
Note that many others have dp solutions, but the easiest way to find them is to write a recursive function that you memoize. A good example of that is http://projecteuler.net/index.php?section=problems&id=301 http://projecteuler.net/index.php?section=problems&id=30....