Sneaking around concatMap: efficient combinators for dynamic programming
Introduction to Algorithms