You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Time Complexity: O(m * n) m: number of nodes in root, n: number of nodes in subRoot, n: number of nodes in subRoot - might call the check function (which is O(n)) on every node in root.
2
+
# Space Complexity: O(n) - use a queue for BFS that can hold up to O(n) nodes in the worst case.
0 commit comments