Skip to content

Commit 010e366

Browse files
fix build
1 parent a9b1bcb commit 010e366

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/java/com/fishercoder/solutions/_1325.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ public TreeNode removeLeafNodes(TreeNode root, int target) {
7676
return root;
7777
}
7878

79-
private boolean hasTargetLeafNodes(TreeNode root, int target) {
80-
if (root == null) {
81-
return false;
82-
}
83-
if (root.left == null && root.right == null && root.val == target) {
84-
return true;
85-
}
86-
return hasTargetLeafNodes(root.left, target) || hasTargetLeafNodes(root.right, target);
87-
}
88-
8979
private TreeNode removeLeafNodes(int target, TreeNode root) {
9080
if (root == null) {
9181
return root;
@@ -104,6 +94,16 @@ private TreeNode removeLeafNodes(int target, TreeNode root) {
10494
removeLeafNodes(target, root.right);
10595
return root;
10696
}
97+
98+
private boolean hasTargetLeafNodes(TreeNode root, int target) {
99+
if (root == null) {
100+
return false;
101+
}
102+
if (root.left == null && root.right == null && root.val == target) {
103+
return true;
104+
}
105+
return hasTargetLeafNodes(root.left, target) || hasTargetLeafNodes(root.right, target);
106+
}
107107
}
108108

109109
public static class Solution2 {

0 commit comments

Comments
 (0)