2015年10月5日

44. Wildcard Matching (String; DP, Back-Track)

摘要: Implement wildcard pattern matching with support for '?' and '*'. *正则表达式的定义: '.' Matches any single character. '*' Matches zero or more of the precedi 阅读全文

posted @ 2015-10-05 19:07 joannae 阅读(163) 评论(0) 推荐(0) 编辑

93. Restore IP Addresses(dfs)

摘要: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135", return ["2 阅读全文

posted @ 2015-10-05 09:51 joannae 阅读(229) 评论(0) 推荐(0) 编辑

40. Combination Sum II (Back-Track)

摘要: Given 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 num 阅读全文

posted @ 2015-10-05 08:31 joannae 阅读(151) 评论(0) 推荐(0) 编辑

39. Combination Sum (Back-Track)

摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文

posted @ 2015-10-05 08:26 joannae 阅读(191) 评论(0) 推荐(0) 编辑

31. Next Permutation (Array; Math)

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文

posted @ 2015-10-05 08:18 joannae 阅读(174) 评论(0) 推荐(0) 编辑

47. Permutations II (Back-Track, Sort)

摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following unique pe 阅读全文

posted @ 2015-10-05 07:07 joannae 阅读(206) 评论(0) 推荐(0) 编辑

46. Permutations (Back-Track,Sort)

摘要: Given a collection of 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 阅读全文

posted @ 2015-10-05 07:01 joannae 阅读(234) 评论(0) 推荐(0) 编辑

77. Combinations (Recursion)

摘要: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文

posted @ 2015-10-05 06:56 joannae 阅读(186) 评论(0) 推荐(0) 编辑

90. Subsets II (Back-Track, DP)

摘要: Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a subset must be in non-descending 阅读全文

posted @ 2015-10-05 06:51 joannae 阅读(140) 评论(0) 推荐(0) 编辑

78. Subsets (Back-Track, DP)

摘要: Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must 阅读全文

posted @ 2015-10-05 06:44 joannae 阅读(250) 评论(0) 推荐(0) 编辑

131. Palindrome Partitioning (Back-Track, DP)

摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl 阅读全文

posted @ 2015-10-05 06:39 joannae 阅读(177) 评论(0) 推荐(0) 编辑

导航