LeetCode题解
关于LeetCode题目的分析以及源代码,更详细的源码存在
https://github.com/czzshr/LeetCode
czzshr
爱折腾CS&T专业在读学生宅男
展开
-
LeetCode: Restore IP Address
题目分析代码参考原创 2014-11-10 22:28:20 · 919 阅读 · 0 评论 -
LeetCode: LRU Cache
题目分析代码参考原创 2014-11-09 21:20:19 · 1055 阅读 · 0 评论 -
LeetCode: Partition List
题目分析代码参考原创 2014-11-08 21:18:04 · 758 阅读 · 0 评论 -
LeetCode: Search a 2D Matrix
题目分析代码原创 2014-11-08 13:56:36 · 813 阅读 · 0 评论 -
LeetCode: Edit Distance
题目分析代码cankao原创 2014-11-07 16:21:44 · 742 阅读 · 0 评论 -
LeetCode: Minimum Path Sum
题目分析代码原创 2014-11-06 21:58:03 · 815 阅读 · 0 评论 -
LeetCode: Unique Paths II
题目分析代码参考原创 2014-11-06 19:54:48 · 869 阅读 · 0 评论 -
LeetCode: Unique Paths
题目分析代码参考原创 2014-11-06 18:57:54 · 881 阅读 · 0 评论 -
LeetCode: N-Queens II
题目分析代码参考原创 2014-11-02 17:46:03 · 930 阅读 · 0 评论 -
LeetCode: N-Queens
题目分析代码参考http://www.cnblogs.com/TenosDoIt/p/3801621.html原创 2014-11-02 15:02:54 · 885 阅读 · 0 评论 -
LeetCode: Remove Duplicates from Sorted List
题目分析代码参考原创 2014-09-21 21:18:43 · 724 阅读 · 0 评论 -
LeetCode: Remove Duplicates from Sorted List II
题目分析代码参考原创 2014-09-25 07:38:54 · 767 阅读 · 0 评论 -
LeetCode: Remove Duplicates from Sorted Array
题目分析代码原创 2014-09-25 08:43:03 · 607 阅读 · 0 评论 -
LeetCode: Remove Duplicates from Sorted Array II
题目https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/分析代码原创 2014-09-25 09:53:18 · 833 阅读 · 0 评论 -
LeetCode: Divide Two Integers
题目分析daima原创 2014-09-25 21:03:13 · 740 阅读 · 0 评论 -
LeetCode: Search in Rotated Sorted Array
题目分析代码参考原创 2014-10-09 22:23:40 · 626 阅读 · 0 评论 -
LeetCode: Search in Rotated Sorted Array II
题目分析源码参考原创 2014-10-16 21:36:26 · 616 阅读 · 0 评论 -
LeetCode: Search for a Range
题目https://oj.leetcode.com/problems/search-for-a-range/分析代码参考原创 2014-10-26 15:57:21 · 694 阅读 · 0 评论 -
LeetCode: Combination Sum
题目分析代码原创 2014-10-26 19:24:22 · 939 阅读 · 0 评论 -
LeetCode: Combination Sum II
题目分析代码原创 2014-10-27 17:06:16 · 824 阅读 · 0 评论 -
Leetcode: Binary Tree Preorder Traversal
题目https://oj.leetcode.com/problems/binary-tree-preorder-traversal/分析1. 第一种方法用gi原创 2014-08-30 11:19:04 · 634 阅读 · 0 评论 -
LeetCode: Binary Tree Postorder Traversal
题目:https://oj.leetcode.com/problems/binary-tree-postorder-traversal/分析:1. 第一种方法用递归的方法做2. dierzho原创 2014-09-03 15:16:37 · 546 阅读 · 0 评论 -
LeetCode: Balanced Binary Tree
题目分析代码原创 2014-09-03 16:10:15 · 646 阅读 · 0 评论 -
LeetCode: Palindrome Partition
题目分析代码class Solution{public: vector> partition(string s) { if (s.empty()) return res; dfs(s, 0); return res; } void dfs(const string &s, int index) { if (index == s.原创 2014-09-05 00:25:07 · 559 阅读 · 0 评论 -
LeetCode: Reverse Words in a String
题目https://oj.leetcode.com/problems/reverse-words-in-a-string/分析运用代码原创 2014-09-08 21:26:31 · 807 阅读 · 0 评论 -
LeetCode: Median of Two Sorted Arrays
题目https://oj.leetcode.com/problems/median-of-two-sorted-arrays/分析代码参考原创 2014-09-09 16:14:15 · 658 阅读 · 0 评论 -
LeetCode: Reverse Integer
题目https://oj.leetcode.com/problems/reverse-integer/分析递归代码原创 2014-09-09 16:28:29 · 625 阅读 · 0 评论 -
LeetCode: Regular Expression Mathing
题目https://oj.leetcode.com/problems/regular-expression-matching/分析1. 普通字符和'.'的匹配很好解决, 直接匹配即可, 关键是'*'如何进行匹配2. 一开始我的想法是, ‘*’尽可能“贪婪”的匹配多个字符, 直到不再匹配为止。 然后在 s = "aaa", p = "a*a" 这个测试用例上跪了。。。原创 2014-09-10 20:15:50 · 747 阅读 · 0 评论 -
LeetCode: Maximum Subarray
题目https://oj.leetcode.com/problems/maximum-subarray/分析代码参考原创 2014-09-14 19:27:18 · 693 阅读 · 0 评论 -
LeetCode: Letter Combinations of a Phone Number
题目:https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/分析:DFS代码:原创 2014-09-14 20:01:11 · 738 阅读 · 0 评论 -
LeetCode: Remove Nth Node From End of List
题目分析代码原创 2014-09-15 10:52:15 · 660 阅读 · 0 评论 -
Leetcode: Sum Root to Leaf Numbers
题目https://oj.leetcode.com/problems/sum-root-to-leaf-numbers/分析DFS原创 2014-08-29 17:12:33 · 658 阅读 · 0 评论 -
Leetcode: Binary Tree Level Order Traversal II
题目https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/分析和原创 2014-08-29 16:27:42 · 617 阅读 · 0 评论 -
Leetcode: Binary Tree Level Order Traversal
题目https://oj.leetcode.com/submissions/detail/10496925/分析1. 层次遍历原创 2014-08-29 16:20:17 · 573 阅读 · 0 评论 -
Leetcode: Decode Ways
题目分析代码参考原创 2014-08-28 19:32:06 · 709 阅读 · 0 评论 -
Leetcode: Word Ladder
Leetcode: Word Ladder原创 2014-08-27 11:46:07 · 928 阅读 · 0 评论 -
Leetcode: Word Search
题目分析代码原创 2014-08-25 21:18:43 · 805 阅读 · 0 评论 -
Leetcode: Anagrams
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.原创 2014-08-22 14:32:42 · 757 阅读 · 0 评论 -
Leetcode: Generate Parenthesis
原题目:https://oj.leetcode.com/problems/generate-parentheses/分析:原创 2014-08-17 21:23:36 · 1023 阅读 · 0 评论 -
Leetcode: Valid Number的三种解法
Leetcode做到Valid Number这道题, 看到参考上说这道题难度为2原创 2014-08-11 11:24:48 · 1669 阅读 · 0 评论