Pregunta de entrevista de Amazon

Typical algorithm problems about array and DFS/BFS