Tap here to switch tabs
Problem
Submissions

Problem: Equal Tree Partition

Equal Tree Partition asks you to remove exactly one edge from a binary tree so it becomes two nonempty trees with equal sums of node values, which may be negative.

Statement

Given the root of a binary tree, return true if removing exactly 11 edge can partition the tree into two non empty trees with equal sums of node values, or false otherwise.

Constraints:

  • The number of nodes in the tree is in the range [1,104][1, 10^4].

  • −105≤-10^5 \leq Node.val ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Equal Tree Partition

Equal Tree Partition asks you to remove exactly one edge from a binary tree so it becomes two nonempty trees with equal sums of node values, which may be negative.

Statement

Given the root of a binary tree, return true if removing exactly 11 edge can partition the tree into two non empty trees with equal sums of node values, or false otherwise.

Constraints:

  • The number of nodes in the tree is in the range [1,104][1, 10^4].

  • −105≤-10^5 \leq Node.val ≤105\leq 10^5