Skip to content

Java Solutions to problems on LintCode

Notifications You must be signed in to change notification settings

tech800/LintCode

Repository files navigation

Java Algorithm Problems

前戏

To host Java Solutions to algorithm problems from LintCode, LeetCode...etc. I Will try to revise the solutions once new problem or new testing case occurs. Mid 2016 I realize that people may want to contribute to this repo, and make it better by contributing fixes, better solutions ... etc. Free free to send pull request. Once verified, I'm happy to merge in! CALM DOWN AND CODE ON! Fellows!

News

2017年1月17日, 陪我征战多年的 2014 MackBookPro i7 3.xGHz 被一杯清水结束了生命,在这里深切缅怀悼念。这个Git Repo是小M陪我一字一句打出来的,有过蹉跎,也有过辉煌,陪我从Day1刷题一直刷到了Day1之中。直至今日,小M记录的代码还在给广大coder带来福利。为了延续小M无私奉献的精神,我将重新在这个repo活跃起来,重整已有的问题,也会尝试总结一些System Design方面的想法,将小M还没有能够达成的梦想实现。

划重点

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

About

Java Solutions to problems on LintCode

Http://www.ShawnFanDev.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java100.0%