LeetCode 314. Binary Tree Vertical Order Traversal

Description https://leetcode.com/problems/binary-tree-vertical-order-traversal/ Given the root of a binary tree, return the vertical order traversal of its nodes’ values. (i.e., from top to bottom, column…

LeetCode 1123. Lowest Common Ancestor of Deepest Leaves

Description https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/ Given the root of a binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a…

LeetCode 199. Binary Tree Right Side View

Description https://leetcode.com/problems/binary-tree-right-side-view/ Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you…

LeetCode 814. Binary Tree Pruning

Description https://leetcode.com/problems/matrix-block-sum/ Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has…

LeetCode 1650. Lowest Common Ancestor of a Binary Tree III

Description https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii/ Given two nodes of a binary tree p and q, return their lowest common ancestor (LCA). Each node will have a reference to its…

LeetCode 117. Populating Next Right Pointers in Each Node II

Description https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each…

LeetCode 235. Lowest Common Ancestor of a Binary Search Tree

Description https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the…

LeetCode 114. Flatten Binary Tree to Linked List

Description https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ Given the root of a binary tree, flatten the tree into a “linked list”: The “linked list” should use the…

LeetCode 236. Lowest Common Ancestor of a Binary Tree

Description https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According…

LeetCode 1315. Sum of Nodes with Even-Valued Grandparent

Description https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/ Given a binary tree, return the sum of values of nodes with even-valued grandparent.  (A grandparent of a node is…