Skip to content

Java Solutions to problems on LintCode/LeetCode

Notifications You must be signed in to change notification settings

GTMHS/LintCode

This branch is 113 commits ahead of terrytong0876/LintCode-1:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fe67807 · Feb 28, 2018
Feb 28, 2018
Jan 16, 2018
Jan 20, 2018
Feb 28, 2018
Feb 27, 2018
Feb 28, 2018
Feb 28, 2018
Mar 3, 2016
Mar 3, 2016
Apr 22, 2016
Feb 28, 2018
Feb 26, 2018
Jul 27, 2017

Repository files navigation

Java Algorithm Problems

程序员的一天

从开始这个Github已经有将近两年时间, 很高兴这个repo可以帮到有需要的人. 我一直认为, 知识本身是无价的, 因此每逢闲暇, 我就会来维护这个repo, 给刷题的朋友们一些我的想法和见解. 下面来简单介绍一下这个repo:

README.md: 所有所做过的题目

ReviewPage.md: 所有题目的总结和归纳(不断完善中)

KnowledgeHash2.md: 对所做过的知识点的一些笔记

SystemDesign.md: 对系统设计的一些笔记

Future Milestone: 我准备将一些有意思的题目,做成视频的形式给大家参考

希望大家学习顺利, 对未来充满希望(程序员也是找到好老板的!) 有问题可以给我写邮件([email protected]), 或者在GitHub上发issue给我.

Squence Problem Level Language Tags Video Tutorial
0 Alien Dictionary.java Hard Java []
1 Anagrams.java Medium Java []
2 Binary Representation.java Hard Java []
3 Binary Tree Inorder Traversal.java Easy Java []
4 Binary Tree Level Order Traversal II.java Medium Java []
5 Binary Tree Level Order Traversal.java Medium Java []
6 Binary Tree Longest Consecutive Sequence.java Medium Java []
7 Binary Tree Maximum Path Sum II.java Medium Java []
8 Binary Tree Path Sum.java Easy Java []
9 Binary Tree Postorder Traversal.java Easy Java []
10 Binary Tree Preorder Traversal.java Easy Java []
11 Binary Tree Right Side View.java Medium Java []
12 Binary Tree Serialization.java Medium Java []
13 Binary Tree Zigzag Level Order Traversal.java Medium Java []
14 Building Outline.java Hard Java []
15 Change to Anagram.java Easy Java []
16 Classical Binary Search.java Easy Java []
17 Climbing Stairs.java Easy Java []
18 Clone Graph.java Medium Java []
19 Closest Binary Search Tree Value.java Easy Java []
20 Closest Number in Sorted Array.java Easy Java []
21 ColorGrid.java Medium Java []
22 Combination Sum II.java Medium Java []
23 Combination Sum.java Medium Java []
24 Combinations.java Medium Java []
25 Compare Strings.java Easy Java []
26 Complete Binary Tree.java Easy Java []
27 Construct Binary Tree from Inorder and Postorder Traversal.java Medium Java []
28 Container With Most Water.java Medium Java []
29 Contains Duplicate II.java Easy Java []
30 Contains Duplicate III.java Medium Java []
31 Contains Duplicate.java Easy Java []
32 Convert Binary Search Tree to Doubly Linked List.java Medium Java []
33 Convert Expression to Polish Notation.java Hard Java []
34 Convert Expression to Reverse Polish Notation.java Hard Java []
35 Convert Integer A to Integer B.java Easy Java []
36 Copy List with Random Pointer.java Medium Java []
37 Cosine Similarity.java Easy Java []
38 Count 1 in Binary.java Easy Java []
39 Count and Say.java Easy Java []
40 Count of Smaller Number before itself.java Hard Java []
41 Count of Smaller Number.java Medium Java []
42 Count Primes.java Easy Java []
43 Course Schedule II.java Medium Java []
44 Course Schedule.java Medium Java []
45 Data Stream Median.java Hard Java []
46 Delete Digits.java Medium Java []
47 Delete Node in the Middle of Singly Linked List.java Easy Java []
48 Encode and Decode Strings.java Medium Java []
49 ExcelSheetColumnNumber .java Easy Java []
50 Expression Evaluation.java Hard Java []
51 Expression Tree Build.java Hard Java []
52 Fast Power.java Medium Java []
53 Fibonacci.java Easy Java []
54 Find Minimum in Rotated Sorted Array II.java N/A Java []
55 Find Minimum in Rotated Sorted Array.java N/A Java []
56 Find Peak Element II.java N/A Java []
57 Find the Connected Component in the Undirected Graph.java Medium Java []
58 Find the Weak Connected Component in the Directed Graph.java Medium Java []
59 First Missing Positive.java N/A Java []
60 Flatten 2D Vector.java Medium Java []
61 Flip Game II.java Medium Java []
62 Flip Game.java Easy Java []
63 Fraction to Recurring Decimal.java Medium Java []
64 Game of Life.java N/A Java []
65 Gas Station.java N/A Java []
66 Generate Parentheses.java Medium Java []
67 Graph Valid Tree.java Medium Java []
68 Gray Code.java Medium Java []
69 Group Anagrams.java Medium Java []
70 Group Shifted Strings.java Easy Java []
71 H-Index II.java Medium Java []
72 H-Index.java Medium Java []
73 Hamming Distance.java Easy Java []
74 Happy Number.java Easy Java []
75 Hash Function.java Easy Java []
76 HashHeap.java Hard Java []
77 HashWithArray.java Easy Java []
78 HashWithCustomizedClass(LinkedList).java Medium Java []
79 Heapify.java Medium Java []
80 Heaters.java Easy Java []
81 House Robber III.java Hard Java []
82 Identical Binary Tree.java Easy Java []
83 Implement Queue by Two Stacks.java N/A Java []
84 Implement Queue using Stacks.java Easy Java []
85 Implement Stack by Two Queues.java Easy Java []
86 Implement Stack using Queues.java Easy Java []
87 Implement Stack.java Easy Java []
88 Implement strStr().java N/A Java []
89 Implement Trie (Prefix Tree).java Medium Java []
90 Implement Trie.java Medium Java []
91 IndexMatch.java Easy Java []
92 Inorder Successor in Binary Search Tree.java Medium Java []
93 Insert Interval.java Easy Java []
94 Insert Node in a Binary Search Tree .java Easy Java []
95 Insertion Sort List.java N/A Java []
96 Integer to English Words.java N/A Java []
97 Interleaving Positive and Negative Numbers.java N/A Java []
98 Intersection of Two Arrays.java Easy Java []
99 Intersection of Two Linked Lists.java Easy Java []
100 Interval Minimum Number.java Medium Java []
101 Interval Sum II.java Hard Java []
102 Interval Sum.java Medium Java []
103 Invert Binary Tree.java Easy Java []
104 Isomorphic Strings.java Easy Java []
105 Jump Game II.java Hard Java []
106 Kth Largest Element.java Medium Java []
107 Kth Smallest Element in a BST.java N/A Java []
108 Kth Smallest Number in Sorted Matrix.java Medium Java []
109 Kth Smallest Sum In Two Sorted Arrays.java Hard Java []
110 Largest Number.java N/A Java []
111 Largest Rectangle in Histogram.java N/A Java []
112 Last Position of Target.java N/A Java []
113 Length of Last Word.java N/A Java []
114 Linked List Cycle II.java N/A Java []
115 Linked List Cycle.java N/A Java []
116 Longest Common Prefix.java Medium Java []
117 Longest Common Substring.java N/A Java []
118 Longest Consecutive Sequence.java N/A Java []
119 Longest Increasing Continuous subsequence II.java N/A Java []
120 Longest Increasing Continuous subsequence.java Easy Java []
121 Longest Palindromic Substring.java Medium Java []
122 Longest Substring with At Most K Distinct Characters.java Medium Java []
123 Longest Substring Without Repeating Characters.java Medium Java []
124 Longest Univalue Path.java Easy Java []
125 Longest Word in Dictionary.java Easy Java []
126 Longest Words.java N/A Java []
127 Lowest Common Ancestor II.java Easy Java []
128 Lowest Common Ancestor of a Binary Search Tree.java Medium Java []
129 Lowest Common Ancestor.java Easy Java []
130 LRU Cache.java Hard Java []
131 Majority Number II.java Medium Java []
132 Majority Number III.java Medium Java []
133 Matrix Zigzag Traversal.java Easy Java []
134 Max Area of Island.java Easy Java []
135 Max Tree.java Hard Java []
136 Maximal Square.java Medium Java []
137 Maximum Average Subarray II.java Review Java []
138 Maximum Depth of Binary Tree.java Easy Java []
139 Maximum Subarray III.java N/A Java []
140 Maximum Subarray.java Easy Java []
141 Maximum SubarrayII.java N/A Java []
142 MaximumSubarrayII.java N/A Java []
143 Median of two Sorted Arrays.java Hard Java []
144 Median.java N/A Java []
145 Meeting Rooms II.java Medium Java []
146 Meeting Rooms.java Easy Java []
147 Merge Intervals.java Easy Java []
148 Merge k Sorted Arrays.java Medium Java []
149 Merge k Sorted Lists.java Medium Java []
150 Merge Sorted Array II.java N/A Java []
151 Merge Sorted Array.java Easy Java []
152 Merge Two Binary Trees.java Easy Java []
153 Merge Two Sorted Lists.java Easy Java []
154 Middle of Linked List.java N/A Java []
155 Min Stack.java Easy Java []
156 Minimum Absolute Difference in BST.java Easy Java []
157 Minimum Height Trees.java N/A Java []
158 Minimum Path Sum.java N/A Java []
159 Minimum Subarray.java N/A Java []
160 Minimum Window Substring.java Hard Java []
161 MinimumDepthOfBinaryTree.java Easy Java []
162 Missing Ranges.java N/A Java []
163 Multiply Strings.java Medium Java []
164 Next Permutation.java Medium Java []
165 Nim Game.java Easy Java []
166 NQueens.java N/A Java []
167 NQueensII.java N/A Java []
168 Nth to Last Node in List.java N/A Java []
169 Number of Airplane in the sky.java Medium Java []
170 Number of Islands II.java Hard Java []
171 Number of Islands.java Medium Java []
172 Number Triangles.java N/A Java []
173 O(1) Check Power of 2.java N/A Java []
174 One Edit Distance.java Medium Java []
175 Paint Fence.java N/A Java []
176 Palindrome Linked List.java N/A Java []
177 Palindrome Partitioning.java N/A Java []
178 Palindrome Permutation II.java Medium Java []
179 Palindrome Permutation.java Easy Java []
180 Partition Array by Odd and Even.java N/A Java []
181 Partition Array.java N/A Java []
182 Partition List.java N/A Java []
183 Pascal's Triangle II.java Easy Java []
184 Peeking Iterator.java N/A Java []
185 Permutation Index.java Easy Java []
186 Permutation Sequence.java Medium Java []
187 Permutations II.java Medium Java []
188 Permutations.java Medium Java []
189 Populating Next Right Pointers in Each Node II.java Hard Java []
190 Product of Array Exclude Itself.java N/A Java []
191 QuickSort.java Easy Java []
192 Recover Rotated Sorted Array.java N/A Java []
193 Rehashing.java Medium Java []
194 Remove Duplicates from Sorted Array.java Easy Java []
195 Remove Duplicates from Sorted List II.java N/A Java []
196 Remove Duplicates from Sorted List.java Easy Java []
197 Remove Duplicates from Unsorted List.java N/A Java []
198 Remove Invalid Parentheses.java Hard Java []
199 Remove Linked List Elements.java N/A Java []
200 Remove Node in Binary Search Tree.java Hard Java []
201 Remove Nth Node From End of List.java N/A Java []
202 Reorder List.java N/A Java []
203 Reshape the Matrix.java Easy Java []
204 Restore IP Addresses.java N/A Java []
205 Reverse Integer.java Easy Java []
206 Reverse Linked List II .java N/A Java []
207 Reverse Linked List.java Easy Java []
208 Reverse String.java Easy Java []
209 Reverse Words in a String II.java Medium Java []
210 Reverse Words in a String.java Medium Java []
211 reverseInteger.java Easy Java []
212 Roman to Integer.java Easy Java []
213 Rotate Image.java Medium Java []
214 Rotate List.java N/A Java []
215 Rotate String.java N/A Java []
216 Russian Doll Envelopes.java N/A Java []
217 Search a 2D Matrix II.java N/A Java []
218 Search a 2D Matrix.java N/A Java []
219 Search for a Range.java N/A Java []
220 Search Insert Position.java N/A Java []
221 Search Range in Binary Search Tree .java Medium Java []
222 Search Rotated in Sorted Array II.java N/A Java []
223 Search Rotated in Sorted Array.java Hard Java []
224 Segment Tree Build II.java Medium Java []
225 Segment Tree Build.java Medium Java []
226 Segment Tree Modify.java Medium Java []
227 Segment Tree Query II.java Medium Java []
228 Segment Tree Query.java Medium Java []
229 Serilization and Deserialization Of Binary Tree.java N/A Java []
230 Shortest Word Distance.java Easy Java []
231 Single Number II.java N/A Java []
232 Single Number III.java N/A Java []
233 Single Number.java Easy Java []
234 Singleton.java N/A Java []
235 Sliding Window Maximum.java N/A Java []
236 Sliding Window Median.java N/A Java []
237 Sort Color.java N/A Java []
238 Sort Colors II.java N/A Java []
239 Sort Letters by Case.java N/A Java []
240 Sort List.java N/A Java []
241 Space Replacement.java N/A Java []
242 Sqrt(x).java Easy Java []
243 Stone Game.java N/A Java []
244 String Permutation.java Easy Java []
245 String to Integer(atoi).java Easy Java []
246 Strobogrammatic Number II.java Medium Java []
247 Strobogrammatic Number.java Easy Java []
248 StrStr.java N/A Java []
249 Subarray Sum Closest.java Medium Java []
250 Subarray Sum.java Easy Java []
251 Subset.java Medium Java []
252 Subsets II.java Medium Java []
253 Subtree.java Easy Java []
254 Summary Ranges.java N/A Java []
255 Surrounded Regions.java N/A Java []
256 Swap Nodes in Pairs.java N/A Java []
257 Symmetric Binary Tree.java Easy Java []
258 The Smallest Difference.java N/A Java []
259 Top K Frequent Elements.java Medium Java []
260 Top K Frequent Words.java Medium Java []
261 Topological Sorting.java Medium Java []
262 Total Occurrence of Target.java N/A Java []
263 Trailing Zeros.java N/A Java []
264 Trapping Rain Water II.java Hard Java []
265 Tweaked Identical Binary Tree.java Easy Java []
266 Two Lists Sum.java N/A Java []
267 Two Strings Are Anagrams.java Easy Java []
268 Ugly Number II.java N/A Java []
269 Ugly Number.java Medium Java []
270 Unique Binary Search Tree II.java N/A Java []
271 Unique Characters.java N/A Java []
272 Unique Word Abbreviation.java N/A Java []
273 Valid Palindrome.java Easy Java []
274 Valid Parentheses.java Easy Java []
275 Valid Sudoku.java Easy Java []
276 Wood Cut.java N/A Java []
277 Word Break.java Medium Java []
278 Word Ladder II.java Hard Java []
279 Word Ladder.java Medium Java []
280 Word Pattern.java Easy Java []
281 Word Search II.java Hard Java []
282 Word Search.java Medium Java []
283 Zigzag Iterator.java N/A Java []
284 Find Anagram Mappings.java Easy Java []
285 Judge Route Circle.java Easy Java []
286 Island Perimeter.java Easy Java []
287 First Unique Character in a String.java Easy Java []
288 Power of Three.java Easy Java []
289 Plus One.java Easy Java []
290 Power of Two.java Easy Java []
291 Reverse Vowels of a String.java Easy Java []
292 Guess Number Higher or Lower.java Easy Java []
293 Encode and Decode TinyURL.java Medium Java []
294 Wiggle Sort.java Medium Java []
295 Queue Reconstruction by Height.java Medium Java []
296 2 Sum.java Easy Java [] Link
297 2 Sum II - Input array is sorted.java Medium Java []
298 2 Sum II.java Medium Java []
299 Coin Change.java Medium Java []
300 Unique Path.java Medium Java []
301 Jump Game.java Medium Java []
302 Maximum Product Subarray.java Medium Java []
303 3 Sum Closest.java Medium Java []
304 Triangle Count.java Medium Java []
305 3 Sum.java Medium Java []
306 4 Sum.java Medium Java []
307 k Sum.java Hard Java []
308 Trapping Rain Water.java Hard Java []
309 Longest Continuous Increasing Subsequence.java Easy Java []
310 Longest Increasing Subsequence.java Medium Java []
311 Unique Binary Search Tree.java Medium Java []
312 Trim a Binary Search Tree.java Easy Java []
313 Unique Paths II.java Medium Java []
314 Counting Bits.java Medium Java []
315 Bomb Enemy.java Medium Java []
316 Paint House.java Easy Java []
317 Decode Ways.java Review Java []
318 House Robber.java Easy Java []
319 House Robber II.java Medium Java []
320 Best Time to Buy and Sell Stock I.java Easy Java []
321 Best Time to Buy and Sell Stock II.java Easy Java []
322 Best Time to Buy and Sell Stock III .java Hard Java []
323 Best Time to Buy and Sell Stock IV.java Hard Java []
324 Paint House II.java Review Java []
325 3 Sum Smaller.java Medium Java []
326 Array Partition I.java Easy Java []
327 1-bit and 2-bit Characters.java Easy Java []
328 Non-decreasing Array.java Easy Java []
329 Max Consecutive Ones.java Easy Java []
330 Find All Numbers Disappeared in an Array.java Easy Java []
331 Maximum Average Subarray I.java Easy Java []
332 Largest Number At Least Twice of Others.java Easy Java []
333 Toeplitz Matrix.java Easy Java []
334 Backpack.java Medium Java []
335 A+B.java Easy Java []
336 Swap Bits.java Easy Java []
337 Update Bits.java Medium Java []
338 Maximum XOR of Two Numbers in an Array.java Medium Java []
339 Coins in a Line.java Medium Java []
340 Perfect Squares.java Medium Java []
341 Palindrome Partitioning II.java Hard Java []
342 Backpack V.java Medium Java []
343 Backpack VI.java Medium Java []
344 Copy Books.java Review Java []
345 Valid Perfect Square.java Review Java []
346 Intersection of Two Arrays II.java Easy Java []
347 First Bad Version.java Easy Java []
348 Backpack II.java Medium Java []
349 Backpack III.java Review Java []
350 Longest Palindromic Subsequence.java Medium Java []
351 Burst Balloons.java Hard Java []
352 Scramble String.java Hard Java []
353 Binary Search Tree Iterator.java Medium Java []
354 Flatten Nested List Iterator.java Medium Java []
355 Coins in a Line III.java Hard Java []
356 Best Time to Buy and Sell Stock with Cooldown.java Medium Java []
357 Find Peak Element.java Medium Java []
358 Longest Common Subsequence.java Medium Java []
359 Interleaving String.java Hard Java []
360 Letter Combinations of a Phone Number.java Medium Java []
361 Edit Distance.java Hard Java []
362 Distinct Subsequences.java Hard Java []
363 Regular Expression Matching.java Review Java []
364 Majority Element.java Easy Java []
365 Wildcard Matching.java Hard Java []
366 Ones and Zeroes.java Hard Java []
367 Pow(x,n).java Medium Java []
368 Word Break II.java Review Java []
369 Nested List Weight Sum.java Easy Java []
370 Same Tree.java Easy Java []
371 Convert Sorted Array to Binary Search Tree.java Easy Java []
372 Binary Tree Maximum Path Sum.java Review Java []
373 Construct Binary Tree from Inorder and Preorder Traversal.java Medium Java []
374 Path Sum.java Easy Java []
375 Add and Search Word.java Medium Java []
376 Add Binary.java Easy Java []
377 Add Digits.java Easy Java []
378 Add Two Numbers.java Medium Java []
379 Add Two Numbers II.java Medium Java []
380 Balanced Binary Tree.java Medium Java []
381 Valid Anagram.java Easy Java []
382 Populating Next Right Pointers in Each Node.java Medium Java []
383 Validate Binary Search Tree.java Medium Java []
384 Convert Sorted List to Binary Search Tree.java Medium Java []
385 Flatten Binary Tree to Linked List.java Medium Java [Binary Tree, DFS]
386 Binary Tree Paths.java Easy Java [Binary Tree, DFS]
387 Minimum Size Subarray Sum.java Medium Java [Array, Binary Search, Two Pointers]

About

Java Solutions to problems on LintCode/LeetCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%