answer
as 0.graph
containing all directed edges corresponding to the detonation relationships between all bombs.visited
.dfs(cur)
to recursively find all reachable nodes from node cur
:
cur
to visited
.dfs(neib)
on each unvisited neighbor of cur
.i
and update answer
as the maximum size of visited
after each DFS.answer
when all DFS operations are complete.