Conviva Interview Question

Whiteboard type algorithm dynamic programming question.