[LeetCode] 1261. Find Elements in a Contaminated Binary Tree (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명Given a binary tree with the following rules:root.val == 0For any treeNode:If treeNode.val has a value x and treeNode.left != null, then treeNode.left.val == 2 * x + 1If treeNode.val has a value x and treeNode.right != null, then treeNode.right.val == 2 * x + 2Now the binary tree is contaminated, which means all treeNode.val have been changed to -1. Implement the FindElements cla..