Directi interview question

Dp and graph problems