Google interview question

A dynamic programming algorithm implementation