Pregunta de entrevista de Google

DFS based question with performance improvement.

Respuesta de la entrevista

Anónimo

29 oct 2021

I solved the question along with performance improvement. The reason for reject was missing boundary conditions.