Convert to Full Binary Tree
Given a binary tree root
, remove all nodes with only one child.
Constraints
n ≤ 100,000
wheren
is the number of nodes inroot
https://binarysearch.com/problems/Convert-to-Full-Binary-Tree
Examples
Example 1
Input
- root =
Output
- answer =
Leave a comment