[leetcode]Palindrome Partitioning

摘要: Palindrome PartitioningGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioni... 阅读全文
posted @ 2014-07-16 00:37 喵星人与汪星人 阅读(205) 评论(0) 推荐(0) 编辑

[leetcode]Letter Combinations of a Phone Number

摘要: Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ... 阅读全文
posted @ 2014-07-15 22:03 喵星人与汪星人 阅读(251) 评论(0) 推荐(0) 编辑

[leetcode]Restore IP Addresses

摘要: Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"255255... 阅读全文
posted @ 2014-07-15 21:37 喵星人与汪星人 阅读(241) 评论(0) 推荐(0) 编辑

[leetcode]Generate Parentheses

摘要: Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol... 阅读全文
posted @ 2014-07-15 20:33 喵星人与汪星人 阅读(243) 评论(0) 推荐(0) 编辑

[leetcode]Word Search

摘要: 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, wh... 阅读全文
posted @ 2014-07-15 19:20 喵星人与汪星人 阅读(685) 评论(0) 推荐(0) 编辑

[leetcode]N-QueensII

摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.算法思路:与[leetcode]... 阅读全文
posted @ 2014-07-14 22:30 喵星人与汪星人 阅读(228) 评论(0) 推荐(0) 编辑

[leetcode]N-Queens

摘要: N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all... 阅读全文
posted @ 2014-07-14 22:09 喵星人与汪星人 阅读(172) 评论(0) 推荐(0) 编辑

[leetcode]Combination Sum

摘要: Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thes... 阅读全文
posted @ 2014-07-14 02:16 喵星人与汪星人 阅读(347) 评论(0) 推荐(0) 编辑

[leetcode]Combination SumII

摘要: Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum... 阅读全文
posted @ 2014-07-14 02:08 喵星人与汪星人 阅读(490) 评论(0) 推荐(0) 编辑

NSum小结

摘要: 本文载自【k sum problem】以及【NSum】有位同僚,对该问题做出了代码的小结,想看吗?戳我戳我。问题陈述:在一个数组,从中找出k个数(每个数不能重复取。数组中同一个值有多个,可以取多个),使得和为零。找出所有这样的组合,要求没有重复项(只要值不同即可,不要求在原数组中的index不同)解... 阅读全文
posted @ 2014-07-13 23:52 喵星人与汪星人 阅读(577) 评论(0) 推荐(0) 编辑