Adobe interview question

A coding question on dynamic programming