您的位置:首页 > 编程语言 > C语言/C++

[LeetCode] Leetcode 题解索引 (C++/Java/Python/Sql)

2015-03-11 09:49 901 查看
全部最新的题解可以在 我的 github 上找,欢迎 star 和 watch ~

更新中~~

说明

这个系列的题解包括用 C++/Java/Python 写的 leetcode 上的算法题目,和 Sql 写的 leetcode 上的数据库题目。

有些题目虽然 AC 了却还没写分析,所以这次就开坑来完成。

链接:

我的 github

Leetcode Algorithms Problems

Leetcode Database Problems

CSDN 题解索引

[LeetCode] 001. Two Sum (Medium) (C++/Java/Python)

[LeetCode] 002. Add Two Numbers (Medium) (C++/Java/Python)

[LeetCode] 003. Longest Substring Without Repeating Characters (Medium) (C++/Java/Python)

[LeetCode] 004. Median of Two Sorted Arrays (Hard) (C++/Java/Python)

[LeetCode] 005. Longest Palindromic Substring (Medium) (C++/Java/Python)

[LeetCode] 006. ZigZag Conversion (Easy) (C++/Java/Python)

[LeetCode] 007. Reverse Integer (Easy) (C++/Java/Python)

[LeetCode] 008. String to Integer (Easy) (C++/Java/Python)

[LeetCode] 009. Palindrome Number (Easy) (C++/Java/Python)

[LeetCode] 010. Regular Expression Matching (Hard) (C++/Java/Python)

[LeetCode] 011. Container With Most Water (Medium) (C++/Java/Python)

[LeetCode] 012. Integer to Roman (Medium) (C++/Java/Python)

[LeetCode] 013. Roman to Integer (Easy) (C++/Java/Python)

[LeetCode] 014. Longest Common Prefix (Easy) (C++/Java/Python)

[LeetCode] 015. 3Sum (Medium) (C++/Java/Python)

[LeetCode] 016. 3Sum Closest (Medium) (C++/Java/Python)

[LeetCode] 017. Letter Combinations of a Phone Number (Medium) (C++/Java/Python)

[LeetCode] 018. 4Sum (Medium) (C++/Java/Python)

[LeetCode] 019. Remove Nth Node From End of List (Easy) (C++/Python)

[LeetCode] 020. Valid Parentheses (Easy) (C++/Java/Python)

[LeetCode] 021. Merge Two Sorted Lists (Easy) (C++/Python)

[LeetCode] 022. Generate Parentheses (Medium) (C++/Java/Python)

[LeetCode] 023. Merge k Sorted Lists (Hard) (C++/Java/Python)

[LeetCode] 024. Swap Nodes in Pairs (Medium) (C++/Python)

[LeetCode] 025. Reverse Nodes in k-Group (Hard) (C++/Java)

[LeetCode] 026. Remove Duplicates from Sorted Array (Easy) (C++/Java)

[LeetCode] 027. Remove Element (Easy) (C++)

[LeetCode] 028. Implement strStr() (Easy) (C++/Python)

[LeetCode] 029. Divide Two Integers (Medium) (C++/Python)

[LeetCode] 030. Substring with Concatenation of All Words (Hard) (C++/Java)

[LeetCode] 031. Next Permutation (Medium) (C++/Python)

[LeetCode] 032. Longest Valid Parentheses (Hard) (C++)

[LeetCode] 033. Search in Rotated Sorted Array (Hard) (C++)

[LeetCode] 034. Search for a Range (Medium) (C++/Java)

[LeetCode] 035. Search Insert Position (Medium) (C++)

[LeetCode] 036. Valid Sudoku (Easy) (C++)

[LeetCode] 037. Sudoku Solver (Hard) (C++)

[LeetCode] 038. Count and Say (Easy) (C++/Python)

Github 题解索引

(最近见 我的 github

There are 241 problems (9 problems for a fee).

I have solved 201 / 232 problems.=w=

[thead]
[/thead]
#ProblemsSolutionsNote
001Two SumC++ Java PythonNote Here
002Add Two NumbersC++ Java PythonNote Here
003Longest Substring Without Repeati…C++ Java PythonNote Here
004Median of Two Sorted ArraysC++ Java PythonNote Here
005Longest Palindromic SubstringC++ Java PythonNote Here
006ZigZag ConversionC++ Java PythonNote Here
007Reverse IntegerC++ Java PythonNote Here
008String to IntegerC++ Java PythonNote Here
009Palindrome NumberC++ Java PythonNote Here
010Regular Expression MatchingC++ Java PythonNote Here
011Container With Most WaterC++ Java PythonNote Here
012Integer to RomanC++ Java PythonNote Here
013Roman to IntegerC++ Java PythonNote Here
014Longest Common PrefixC++ Java PythonNote Here
0153SumC++ Java PythonNote Here
0163Sum ClosestC++ Java PythonNote Here
017Letter Combinations of a Phone NumberC++ Java PythonNote Here
0184SumC++ Java PythonNote Here
019Remove Nth Node From End of ListC++ PythonNote Here
020Valid ParenthesesC++ Java PythonNote Here
021Merge Two Sorted ListsC++ PythonNote Here
022Generate ParenthesesC++ Java PythonNote Here
023Merge k Sorted ListsC++ Java PythonNote Here
024Swap Nodes in PairsC++ PythonNote Here
025Reverse Nodes in k-GroupC++ JavaNote Here
026Remove Duplicates from Sorted ArrayC++Note Here
027Remove ElementC++Note Here
028Implement strStr()C++ PythonNote Here
029Divide Two IntegersC++ PythonNote Here
030Substring with Concatenation of A…C++ JavaNote Here
031Next PermutationC++ PythonNote Here
032Longest Valid ParenthesesC++Note Here
033Search in Rotated Sorted ArrayC++Note Here
034Search for a RangeC++ JavaNote Here
035Search Insert PositionC++Note Here
036Valid SudokuC++Note Here
037Sudoku SolverC++Note Here
038Count and SayC++ PythonNote Here
039Combination SumC++Coming soon
040Combination Sum IIC++Coming soon
041First Missing PositiveC++Coming soon
042Trapping Rain WaterC++Coming soon
043Multiply StringsC++Coming soon
044Wildcard MatchingC++Coming soon
045Jump Game IIC++Coming soon
046PermutationsC++Coming soon
047Permutations IIC++Coming soon
048Rotate ImageC++Coming soon
049AnagramsC++Coming soon
050Pow(x, n)C++Coming soon
051N-QueensC++ Java PythonComing soon
052N-Queens IIC++ Java PythonComing soon
053Maximum SubarrayC++Coming soon
054Spiral MatrixC++Coming soon
055Jump GameC++Coming soon
056Merge IntervalsC++Coming soon
057Insert IntervalC++Coming soon
058Length of Last WordC++Coming soon
059Spiral Matrix IIC++Coming soon
060Permutation SequenceC++Coming soon
061Rotate ListC++Coming soon
062Unique PathsC++Coming soon
063Unique Paths IIC++Coming soon
064Minimum Path SumC++Coming soon
065Valid NumberC++ Java PythonComing soon
066Plus OneC++Coming soon
067Add BinaryC++Coming soon
068Text JustificationC++ Java PythonNote Here
069Sqrt(x)C++ Java PythonComing soon
070Climbing StairsC++Coming soon
071Simplify PathC++ Java PythonComing soon
072Edit DistanceC++Coming soon
073Set Matrix ZeroesC++Coming soon
074Search a 2D MatrixC++Coming soon
075Sort ColorsC++Coming soon
076Minimum Window SubstringC++Note Here
077CombinationsC++Coming soon
078SubsetsC++ Java PythonComing soon
079Word SearchC++Coming soon
080Remove Duplicates from Sorted Array IIC++Coming soon
081Search in Rotated Sorted Array IIC++Coming soon
082Remove Duplicates from Sorted List IIC++Coming soon
083Remove Duplicates from Sorted ListC++Coming soon
084Largest Rectangle in HistogramC++ JavaNote Here
085Maximal RectangleC++ JavaNote Here
086Partition ListC++ Java PythonComing soon
087Scramble StringC++ Java PythonNote Here
088Merge Sorted ArrayC++Coming soon
089Gray CodeC++ Java PythonComing soon
090Subsets IIC++ Java PythonComing soon
091Decode WaysC++ Java PythonComing soon
092Reverse Linked List IIC++Coming soon
093Restore IP AddressesC++ Java PythonNote Here
094Binary Tree Inorder TraversalC++Coming soon
095Unique Binary Search TreesC++Note Here
096Unique Binary Search Trees IIC++Note Here
097Interleaving StringC++ JavaNote Here
098Validate Binary Search TreeC++ Java PythonNote Here
099Recover Binary Search TreeC++ PythonNote Here
100Same TreeC++Coming soon
101Symmetric TreeC++Coming soon
102Binary Tree Level Order TraversalC++ PythonNote Here
103Binary Tree Zigzag Level Order TraversalC++ PythonNote Here
104Maximum Depth of Binary TreeC++Coming soon
105Construct Binary Tree from Preord…C++Note Here
106Construct Binary Tree from Inorde…C++Note Here
107Binary Tree Level Order Traversal IIC++ PythonNote Here
108Convert Sorted Array to Binary Se…C++Note Here
109Convert Sorted List to Binary Sea…C++ PythonNote Here
110Balanced Binary TreeC++Coming soon
111Minimum Depth of Binary TreeC++Coming soon
112Path SumC++Coming soon
113Path Sum IIC++ Java PythonComing soon
114Flatten Binary Tree to Linked ListC++ JavaNote Here
115Distinct SubsequencesC++ PythonNote Here
116Populating Next Right Pointers in…C++ Java PythonComing soon
117Populating Next Right Pointers in…C++ Java PythonComing soon
118Pascals TriangleC++Coming soon
119Pascal’s Triangle IIC++Coming soon
120TriangleC++ Java PythonComing soon
121Best Time to Buy and Sell StockC++ PythonNote Here
122Best Time to Buy and Sell Stock IIC++ PythonNote Here
123Best Time to Buy and Sell Stock IIIC++ PythonNote Here
124Binary Tree Maximum Path SumC++ PythonNote Here
125Valid PalindromeC++Coming soon
126Word LadderC++ PythonNote Here
127Word Ladder IIComing soonComing soon
128Longest Consecutive SequenceComing soonComing soon
129Sum Root to Leaf NumbersC++Coming soon
130Surrounded RegionsC++Note Here
131Palindrome PartitioningC++ PythonNote Here
132Palindrome Partitioning IIC++ JavaNote Here
133Clone GraphC++Coming soon
134Gas StationC++Note Here
135CandyComing soonComing soon
136Single NumberC++Coming soon
137Single Number IIC++Coming soon
138Copy List with Random PointerC++ Java PythonNote Here
139Word BreakC++ PythonNote Here
140Word Break IIComing soonComing soon
141Linked List CycleC++Coming soon
142Linked List Cycle IIComing soonComing soon
143Reorder ListC++Coming soon
144Binary Tree Preorder TraversalC++Coming soon
145Binary Tree Postorder TraversalC++Coming soon
146LRU CacheC++ PythonNote Here
147Insertion Sort ListC++Coming soon
148Sort ListC++Note Here
149Max Points on a LineComing soonComing soon
150Evaluate Reverse Polish NotationC++ Java PythonNote Here
151Reverse Words in a StringC++ Java PythonNote Here
152Maximum Product SubarrayC++Coming soon
153Find Minimum in Rotated Sorted ArrayC++Note Here
154Find Minimum in Rotated Sorted Array IIC++ PythonNote Here
155Min StackC++Coming soon
156Binary Tree Upside Down $Not BuyNot Buy
157Read N Characters Given Read4 $Not BuyNot Buy
158Read N Characters Given Read4 II … $Not BuyNot Buy
159Longest Substring with At Most Tw… $Not BuyNot Buy
160Intersection of Two Linked ListsC++Coming soon
161One Edit Distance $Not BuyNot Buy
162Find Peak ElementC++ Java PythonComing soon
163Missing Ranges $Not BuyNot Buy
164Maximum GapC++Note Here
165Compare Version NumbersC++Coming soon
166Fraction to Recurring DecimalC++Note Here
167Two Sum II - Input array is sorted $Not BuyNot Buy
168Excel Sheet Column TitleC++ Java PythonComing soon
169Majority ElementC++ Java PythonComing soon
170Two Sum III - Data structure design $Not BuyNot Buy
171Excel Sheet Column NumberC++ Java PythonComing soon
172Factorial Trailing ZeroesC++ Java PythonComing soon
173Binary Search Tree IteratorC++ PythonNote Here
174Dungeon GameComing soonComing soon
175Combine Two TablesSQLComing soon
176Second Highest SalarySQLComing soon
177Nth Highest SalarySQLNote Here
178Rank ScoresSQLNote Here
179Largest NumberC++ Java PythonComing soon
180Consecutive NumbersSQLNote Here
181Employees Earning More Than Their…SQLComing soon
182Duplicate EmailsSQLComing soon
183Customers Who Never OrderSQLNote Here
184Department Highest SalarySQLNote Here
185Department Top Three SalariesComing soonComing soon
186Reverse Words in a String II $Not BuyNot Buy
187Repeated DNA SequencesC++ Java PythonComing soon
188Best Time to Buy and Sell Stock IVC++Note Here
189Rotate ArrayC++Note Here
190Reverse BitsC++ Java PythonNote Here
191Number of 1 BitsC++ JavaNote Here
192Word FrequencyShell ScriptNote Here
193Valid Phone NumbersShell ScriptNote Here
194Transpose FileShell ScriptNote Here
195Tenth LineShell ScriptNote Here
196Delete Duplicate EmailsSQLComing soon
197Rising TemperatureSQLNote Here
198House RobberC++Note Here
199Binary Tree Right Side ViewC++ PythonNote Here
200Number of IslandsC++Note Here
201Bitwise AND of Numbers RangeC++ PythonNote Here
202Happy NumberC++ PythonNote Here
203Remove Linked List ElementsC++ Java PythonNote Here
204Count PrimesC++Coming soon
205Isomorphic StringsC++ PythonNote Here
206Reverse Linked ListC++Coming soon
207Course ScheduleComing soonComing soon
208Implement Trie (Prefix Tree)Coming soonComing soon
209Minimum Size Subarray SumComing soonComing soon
210Course Schedule IIComing soonComing soon
211Add and Search Word - Data struct…Coming soonComing soon
212Word Search IIComing soonComing soon
213House Robber IIComing soonComing soon
214Shortest PalindromeComing soonComing soon
215Kth Largest Element in an ArrayComing soonComing soon
216Combination Sum IIIComing soonComing soon
217Contains DuplicateC++ PythonNote Here
218The Skyline ProblemComing soonComing soon
219Contains Duplicate IIC++Note Here
220Contains Duplicate IIIC++ JavaNote Here
221Maximal SquareComing soonComing soon
222Count Complete Tree NodesComing soonComing soon
223Rectangle AreaC++Note Here
224Basic CalculatorComing soonComing soon
225Implement Stack using QueuesC++ JavaNote Here
226Invert Binary TreeC++ PythonNote Here
227Basic Calculator IIComing soonComing soon
228Summary RangesC++ PythonNote Here
229Majority Element IIComing soonComing soon
230Kth Smallest Element in a BSTComing soonComing soon
231Power of TwoC++ PythonNote Here
232Implement Queue using StacksC++ PythonNote Here
233Number of Digit OneComing soonComing soon
234Palindrome Linked ListC++ Java PythonNote Here
235Lowest Common Ancestor of a Binar…C++ PythonNote Here
236Lowest Common Ancestor of a Binary TreeComing soonComing soon
237Delete Node in a Linked ListC++ PythonNote Here
238Product of Array Except SelfComing soonComing soon
239Sliding Window MaximumComing soonComing soon
240Search a 2D Matrix IIComing soonComing soon
241Different Ways to Add ParenthesesComing soonComing soon
如果有什么错误请指出来,欢迎探讨~

留言或 Email: iilluzen at google’s mail service
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: