Google interview question

Recursion dynamic programming and bfs