暴力搜索
益达915
一名在读大学生,渣渣一枚,进取中...
展开
-
LeetCode | Subsets I,II
Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example, If nums = [1,2,3], a solution is:[ [3], [1], [2],原创 2016-08-13 20:31:44 · 267 阅读 · 0 评论 -
LeetCode | Permutations I,II
Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]原创 2016-08-14 08:50:27 · 272 阅读 · 0 评论 -
LeetCode | Letter Combinations of a Phone Number
Given 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) is given below.Input:Digit string “23”原创 2016-08-14 10:50:43 · 195 阅读 · 0 评论 -
LeetCode | Combinations
Given 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:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ]比较原创 2016-08-14 09:22:10 · 211 阅读 · 0 评论