[LeetCode] Correct a Binary Tree

1 · · Aug. 8, 2022, 1:34 p.m.
1660. Correct a Binary Tree You have a binary tree with a small defect. There is exactly one invalid node where its right child incorrectly points to another node at the same depth but to the invalid node’s right. Given the root of the binary tree with this defect, root, return the root of the binary tree after removing this invalid node and every node underneath it (minus the node it incorrectly points to). Custom testing: The test input is read as 3 lines: TreeNode root int fromNode (not ava...