Adobe interview question

Dp and graph based coding question