leetcode.com 2024-01-10
🟡2385.amount-of-time-for-binary-tree-to-be-infected
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
🟡2385.amount-of-time-for-binary-tree-to-be-infected
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
Telegraph
amount-of-time-for-binary-tree-to-be-infected
You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start. Each minute, a node becomes infected if:
leetcode.com 2024-01-11
🟡1026.maximum-difference-between-node-and-ancestor
🏷️ Tags
#tree #depth_first_search #binary_tree
🟡1026.maximum-difference-between-node-and-ancestor
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
maximum-difference-between-node-and-ancestor
Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b. A node a is an ancestor of b if either: any child of a is equal to b or any child of a is an ancestor…