随笔分类 -  leetcode

上一页 1 ··· 3 4 5 6 7

[leetcode]Linked List Cycle
摘要:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?算法思路1:快慢指针,当两个指针相遇,则表示有环,... 阅读全文

posted @ 2014-07-19 14:59 喵星人与汪星人 阅读(293) 评论(0) 推荐(0) 编辑

[leetcode]Palindrome Number
摘要:Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers b... 阅读全文

posted @ 2014-07-17 23:35 喵星人与汪星人 阅读(213) 评论(0) 推荐(0) 编辑

[leetcode]Reverse Integer
摘要:Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about th... 阅读全文

posted @ 2014-07-17 20:40 喵星人与汪星人 阅读(189) 评论(0) 推荐(0) 编辑

[leetcode]Plus One
摘要:Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant dig... 阅读全文

posted @ 2014-07-17 19:43 喵星人与汪星人 阅读(200) 评论(0) 推荐(0) 编辑

[leetcode]Set Matrix Zeroes
摘要:Set Matrix ZeroesGiven amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight... 阅读全文

posted @ 2014-07-17 16:56 喵星人与汪星人 阅读(199) 评论(0) 推荐(0) 编辑

leetcode中关于树的dfs算法题
摘要:Validate Binary Search TreeRecover Binary Search TreeSymmetric TreeSame TreeMaximum Depth of Binary TreeConstruct Binary Tree from Preorder and Inorde... 阅读全文

posted @ 2014-07-16 21:20 喵星人与汪星人 阅读(367) 评论(0) 推荐(0) 编辑

[leetcode]Count and Say
摘要:Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r... 阅读全文

posted @ 2014-07-16 20:42 喵星人与汪星人 阅读(395) 评论(0) 推荐(0) 编辑

[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 喵星人与汪星人 阅读(206) 评论(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 喵星人与汪星人 阅读(253) 评论(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 喵星人与汪星人 阅读(243) 评论(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 喵星人与汪星人 阅读(229) 评论(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 喵星人与汪星人 阅读(173) 评论(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 喵星人与汪星人 阅读(348) 评论(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 喵星人与汪星人 阅读(491) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7