educative.io

Educative

Is it possible to solve this using DFS?

Hi guys just wondering if anyone has solved this using DFS ?