|[659. Split Array into Consecutive Subsequences](https://leetcode.com/problems/split-array-into-consecutive-subsequences/)|[Solution](https://.com/fluency03/leetcode-java/blob/master/src/SplitArrayIntoConsecutiveSubsequences659.java)| Medium |
|[662. Maximum Width of Binary Tree](https://leetcode.com/problems/maximum-width-of-binary-tree/)|[Solution](https://.com/fluency03/leetcode-java/blob/master/src/MaximumWidthOfBinaryTree662.java)| Medium |
495
+
|[663. Equal Tree Partition](https://leetcode.com/problems/equal-tree-partition/)|[Solution](https://.com/fluency03/leetcode-java/blob/master/src/EqualTreePartition663.java)| Medium |
|[669. Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree/)|[Solution](https://.com/fluency03/leetcode-java/blob/master/src/TrimABinarySearchTree669.java)| Easy |
497
498
|[671. Second Minimum Node In a Binary Tree](https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/)|[Solution](https://.com/fluency03/leetcode-java/blob/master/src/SecondMinimumNodeInABinaryTree671.java)| Easy |
Original file line number
Diff line number
Diff line change
@@ -0,0 +1,72 @@
1
+
/**
2
+
* Given a binary tree with n nodes, your task is to check if it's possible to
3
+
* partition the tree to two trees which have the equal sum of values after
4
+
* removing exactly one edge on the original tree.
5
+
*
6
+
* Example 1:
7
+
* Input:
8
+
* 5
9
+
* / \
10
+
* 10 10
11
+
* / \
12
+
* 2 3
13
+
*
14
+
* Output: True
15
+
*
16
+
* Explanation:
17
+
* 5
18
+
* /
19
+
* 10
20
+
* Sum: 15
21
+
*
22
+
* 10
23
+
* / \
24
+
* 2 3
25
+
* Sum: 15
26
+
*
27
+
* Example 2:
28
+
*
29
+
* Input:
30
+
* 1
31
+
* / \
32
+
* 2 10
33
+
* / \
34
+
* 2 20
35
+
*
36
+
* Output: False
37
+
*
38
+
* Explanation: You can't split the tree into two trees with equal sum after
39
+
* removing exactly one edge on the tree.
40
+
*
41
+
* Note:
42
+
* The range of tree node value is in the range of [-100000, 100000].
0 commit comments