Kunato interview question

Backtracking question Dynamic programming question