Tag: breadth first search
Given a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = Output: 15 Constraints: The number of nodes in the tree is …
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate …
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level X …
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make …