Recursive Depth First Search Algorithm to Convert to Full Binary Tree By Removing Single-Child Nodes
Given a binary tree root, remove all nodes with only one child. Constraints n ≤ 100,000 where n is the number of nodes in root Example 1 Input root …