Can you give hint for this question

can you give hint for this question or concept related to this

Hint : Dynamic Programming else try recursive and add memoisation later.