Skip to content

Commit 5da5b60

Browse files
refactor 563
1 parent 05be332 commit 5da5b60

File tree

1 file changed

+0
-26
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-26
lines changed

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,6 @@
22

33
import com.fishercoder.common.classes.TreeNode;
44

5-
/**
6-
* 563. Binary Tree Tilt
7-
*
8-
* Given a binary tree, return the tilt of the whole tree.
9-
* The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values
10-
* and the sum of all right subtree node values.
11-
* Null node has tilt 0.
12-
* The tilt of the whole tree is defined as the sum of all nodes' tilt.
13-
14-
Example:
15-
Input:
16-
1
17-
/ \
18-
2 3
19-
20-
Output: 1
21-
22-
Explanation:
23-
Tilt of node 2 : 0
24-
Tilt of node 3 : 0
25-
Tilt of node 1 : |2-3| = 1
26-
Tilt of binary tree : 0 + 0 + 1 = 1
27-
28-
Note:
29-
The sum of node values in any subtree won't exceed the range of 32-bit integer.
30-
All the tilt values won't exceed the range of 32-bit integer.*/
315
public class _563 {
326
public static class Solution1 {
337

0 commit comments

Comments
 (0)