Count Numbers with Unique Digits
Count Numbers with Unique DigitsGiven a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10^n. For example:1Given n = 2, return 91. (The answer should be the total nu
Count Numbers with Unique DigitsGiven a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10^n. For example:1Given n = 2, return 91. (The answer should be the total nu
Combination Sum IIIFind all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Examp
Add and Search Word - Data structure designDesign a data structure that supports the following two operations: 12void addWord(word)bool search(word) search(word) can search a literal word or a regula
Palindrome PartitioningGiven a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example:Given s = “aab”,Return 1
Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations. For example:123Given "25525511135",return ["255.255.11.13
Subsets IIGiven a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example:If nums = [1,2,2], a
Word SearchGiven a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or v
CombinationsGiven two integers n and k, return all possible combinations of k numbers out of 1 … n. For example:If n = 4 and k = 2, a solution is: 12345678[ [2,4], [3,4], [2,3], [1,2], [1,3], [
Permutation SequenceThe set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3): “123” “132
Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations. For example:[1,1,2] have the following unique permutations: 12345[ [1,1,2], [1,2
PermutationsGiven a collection of distinct numbers, return all possible permutations. For example:[1,2,3] have the following permutations: 12345678[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once
Combination SumGiven a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may
Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example:Given n = 3, a solution set is: 1234567[ "((()))",
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons)
Binary WatchA binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least signifi