We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f69029f commit 58a1007Copy full SHA for 58a1007
subtree-of-another-tree/forest000014.java
@@ -41,6 +41,7 @@ private boolean dfs(TreeNode root, TreeNode subRoot) {
41
private boolean compareTrees(TreeNode root1, TreeNode root2) {
42
if (root1 == null && root2 == null) return true;
43
if (root1 == null || root2 == null) return false;
44
+
45
if (root1.val != root2.val) return false;
46
47
return compareTrees(root1.left, root2.left) && compareTrees(root1.right, root2.right);
0 commit comments