I think most DFS solutions are O(n^2), if you don't do "remove node"


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.