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 …
You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: This …
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, sc) representing …