摘要: Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文
posted @ 2015-05-30 00:41 `Liok 阅读(457) 评论(0) 推荐(0) 编辑
摘要: Tenth LineHow would you print just the 10th line of a file?For example, assume thatfile.txthas the following content:Line 1Line 2Line 3Line 4Line 5Lin... 阅读全文
posted @ 2015-05-30 00:17 `Liok 阅读(384) 评论(0) 推荐(0) 编辑
摘要: Remove Linked List ElementsRemove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,va... 阅读全文
posted @ 2015-05-28 00:43 `Liok 阅读(399) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIIFind all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combin... 阅读全文
posted @ 2015-05-26 23:24 `Liok 阅读(405) 评论(0) 推荐(0) 编辑
摘要: Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum... 阅读全文
posted @ 2015-05-26 23:12 `Liok 阅读(662) 评论(0) 推荐(0) 编辑
摘要: Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol... 阅读全文
posted @ 2015-05-26 01:04 `Liok 阅读(609) 评论(0) 推荐(0) 编辑
摘要: Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at leas... 阅读全文
posted @ 2015-05-26 01:02 `Liok 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Regular Expression MatchingImplement regular expression matchingwith support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of... 阅读全文
posted @ 2015-05-25 13:13 `Liok 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2015-05-24 23:54 `Liok 阅读(766) 评论(0) 推荐(0) 编辑
摘要: Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the... 阅读全文
posted @ 2015-05-24 00:41 `Liok 阅读(645) 评论(0) 推荐(0) 编辑