Skip to content

Commit 496d207

Browse files
committed
Fixed checkstyle warnings.
1 parent 45ae0f9 commit 496d207

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/main/java/g0101_0200/s0111_minimum_depth_of_binary_tree/Solution.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ public int minDepth(TreeNode root) {
1616
int size = queue.size();
1717
for (int i = 0; i < size; i++) {
1818
TreeNode current = queue.poll();
19-
if (current.left == null && current.right == null && d > 0) return d + 1;
20-
if (current.right != null) queue.add(current.right);
21-
if (current.left != null) queue.add(current.left);
19+
if (current.left == null && current.right == null && d > 0) {
20+
return d + 1;
21+
}
22+
if (current.right != null) {
23+
queue.add(current.right);
24+
}
25+
if (current.left != null) {
26+
queue.add(current.left);
27+
}
2228
}
23-
2429
d++;
2530
}
26-
2731
return d;
2832
}
2933
}

src/main/java/g0101_0200/s0113_path_sum_ii/Solution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
public class Solution {
88
public List<List<Integer>> pathSum(TreeNode root, int targetSum) {
99
List<List<Integer>> res = new ArrayList<>();
10-
if (root == null) return res;
10+
if (root == null) {
11+
return res;
12+
}
1113
recur(res, new ArrayList<>(), 0, targetSum, root);
1214
return res;
1315
}

0 commit comments

Comments
 (0)