## Subsets

QUESTION Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. This question is provided by Leetocode.

QUESTION Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. This question is provided by Leetocode.

QUESTION Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible Read the full article…

QUESTION Implement int sqrt(int x). Compute and return the square root of x. This question is provided by Leetocode.

QUESTION Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. This question is provided by Leetocode.

QUESTION Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. This question is provided by Leetocode.

QUESTION Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. This question is Read the full article…

QUESTION Given an absolute path for a file (Unix-style), simplify it. This question is provided by Leetocode.

QUESTION Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. This question is provided by Leetocode.

QUESTION Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array. This question is provided by Leetocode.

QUESTION Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = “great”:

1 2 3 4 5 6 7 |
great / gr eat / / g r e at / a t |

To scramble the string, we may choose any non-leaf node and swap its two children. For example, if we choose the node “gr” and Read the full article…

- « Previous Page
- 1
- 2
- 3
- 4
- 5
- 6
- …
- 15
- Next Page »