Tag: recursion
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with …
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or …
You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an integer followed by zero, …
Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all …
A string S represents a list of words. Each letter in the word has 1 or more options. If there is one option, the letter is represented as is. …