Skip to content

awangdev/leet-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LintCode

To host Java Solutions to problems from LintCode(http://LintCode.com). I Will try to revise the solutions once new problem or new testing case occurs.

Squence Problem Level Language
0 [2 Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/2 Sum.java) Java
1 [3 Sum Closest.java](https://github.com/shawnfan/LintCode/blob/master/Java/3 Sum Closest.java) Java
2 [3 Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/3 Sum.java) Java
3 [4 Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/4 Sum.java) Java
4 A+B.java Java
5 [Add and Search Word.java](https://github.com/shawnfan/LintCode/blob/master/Java/Add and Search Word.java) Java
6 [Add Binary.java](https://github.com/shawnfan/LintCode/blob/master/Java/Add Binary.java) Java
7 Anagrams.java Java
8 Backpack.java Java
9 [Balanced Binary Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Balanced Binary Tree.java) Java
10 [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) Java
11 [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) Java
12 [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) Java
13 [Binary Representation.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Representation.java) Java
14 [Binary Search.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Search.java) Java
15 [Binary Tree Level Order Traversal II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Tree Level Order Traversal II.java) Java
16 [Binary Tree Level Order Traversal.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Tree Level Order Traversal.java) Java
17 [Binary Tree Maximum Path Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Tree Maximum Path Sum.java) Java
18 [Binary Tree Preorder Traversal.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Tree Preorder Traversal.java) Java
19 [Binary Tree Zigzag Level Order Traversal.java](https://github.com/shawnfan/LintCode/blob/master/Java/Binary Tree Zigzag Level Order Traversal.java) Java
20 BinaryTreeInorderTraversal.java Java
21 BinaryTreePostorderTraversal.java Java
22 [Classical Binary Search.java](https://github.com/shawnfan/LintCode/blob/master/Java/Classical Binary Search.java) Java
23 [Climbing Stairs.java](https://github.com/shawnfan/LintCode/blob/master/Java/Climbing Stairs.java) Java
24 [Clone Graph.java](https://github.com/shawnfan/LintCode/blob/master/Java/Clone Graph.java) Java
25 [Combination Sum II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Combination Sum II.java) Java
26 [Combination Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Combination Sum.java) Java
27 Combinations.java Java
28 [Compare Strings.java](https://github.com/shawnfan/LintCode/blob/master/Java/Compare Strings.java) Java
29 [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) Java
30 [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) Java
31 [Container With Most Water.java](https://github.com/shawnfan/LintCode/blob/master/Java/Container With Most Water.java) Java
32 [Convert Expression to Polish Notation.java](https://github.com/shawnfan/LintCode/blob/master/Java/Convert Expression to Polish Notation.java) Java
33 [Convert Expression to Reverse Polish Notation.java](https://github.com/shawnfan/LintCode/blob/master/Java/Convert Expression to Reverse Polish Notation.java) Java
34 [Convert Integer A to Integer B.java](https://github.com/shawnfan/LintCode/blob/master/Java/Convert Integer A to Integer B.java) Java
35 [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) Java
36 [Convert Sorted List to Binary Search Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Convert Sorted List to Binary Search Tree.java) Java
37 [Copy List with Random Pointer.java](https://github.com/shawnfan/LintCode/blob/master/Java/Copy List with Random Pointer.java) Java
38 [Count 1 in Binary.java](https://github.com/shawnfan/LintCode/blob/master/Java/Count 1 in Binary.java) Java
39 [Count and Say.java](https://github.com/shawnfan/LintCode/blob/master/Java/Count and Say.java) Java
40 [Data Stream Median.java](https://github.com/shawnfan/LintCode/blob/master/Java/Data Stream Median.java) Java
41 [Delete Digits.java](https://github.com/shawnfan/LintCode/blob/master/Java/Delete Digits.java) Java
42 [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) Java
43 [Distinct Subsequences.java](https://github.com/shawnfan/LintCode/blob/master/Java/Distinct Subsequences.java) Java
44 [Easy Reverse Linked List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Easy Reverse Linked List.java) Java
45 [Edit Distance.java](https://github.com/shawnfan/LintCode/blob/master/Java/Edit Distance.java) Java
46 [Expression Evaluation.java](https://github.com/shawnfan/LintCode/blob/master/Java/Expression Evaluation.java) Java
47 [Expression Tree Build.java](https://github.com/shawnfan/LintCode/blob/master/Java/Expression Tree Build.java) Java
48 [Fast Power.java](https://github.com/shawnfan/LintCode/blob/master/Java/Fast Power.java) Java
49 Fibonacci.java Java
50 [Find a Peak.java](https://github.com/shawnfan/LintCode/blob/master/Java/Find a Peak.java) Java
51 [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
52 [Find Minimum in Rotated Sorted Array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Find Minimum in Rotated Sorted Array.java) Java
53 [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) Java
54 [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) Java
55 [First Bad Version.java](https://github.com/shawnfan/LintCode/blob/master/Java/First Bad Version.java) Java
56 [First Missing Positive.java](https://github.com/shawnfan/LintCode/blob/master/Java/First Missing Positive.java) Java
57 [Gas Station.java](https://github.com/shawnfan/LintCode/blob/master/Java/Gas Station.java) Java
58 [Hash Function.java](https://github.com/shawnfan/LintCode/blob/master/Java/Hash Function.java) Java
59 Heapify.java Java
60 [Identical Binary Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Identical Binary Tree.java) Java
61 [Implement Queue by Two Stacks.java](https://github.com/shawnfan/LintCode/blob/master/Java/Implement Queue by Two Stacks.java) Java
62 [Insert Interval.java](https://github.com/shawnfan/LintCode/blob/master/Java/Insert Interval.java) Java
63 [Insert Node in a Binary Search Tree .java](https://github.com/shawnfan/LintCode/blob/master/Java/Insert Node in a Binary Search Tree .java) Java
64 [Insertion Sort List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Insertion Sort List.java) Java
65 [Interleaving String.java](https://github.com/shawnfan/LintCode/blob/master/Java/Interleaving String.java) Java
66 [Invert Binary Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Invert Binary Tree.java) Java
67 [Jump Game II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Jump Game II.java) Java
68 [Jump Game.java](https://github.com/shawnfan/LintCode/blob/master/Java/Jump Game.java) Java
69 [Kth Largest Element.java](https://github.com/shawnfan/LintCode/blob/master/Java/Kth Largest Element.java) Java
70 [Largest Number.java](https://github.com/shawnfan/LintCode/blob/master/Java/Largest Number.java) Java
71 [Largest Rectangle in Histogram.java](https://github.com/shawnfan/LintCode/blob/master/Java/Largest Rectangle in Histogram.java) Java
72 [Length of Last Word.java](https://github.com/shawnfan/LintCode/blob/master/Java/Length of Last Word.java) Java
73 [Linked List Cycle.java](https://github.com/shawnfan/LintCode/blob/master/Java/Linked List Cycle.java) Java
74 [Longest Common Prefix.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Common Prefix.java) Java
75 [Longest Common Subsequence.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Common Subsequence.java) Java
76 [Longest Common Substring.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Common Substring.java) Java
77 [Longest Consecutive Sequence.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Consecutive Sequence.java) Java
78 [Longest Increasing Continuous subsequence II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Increasing Continuous subsequence II.java) Java
79 [Longest Increasing Continuous subsequence.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Increasing Continuous subsequence.java) Java
80 [Longest Palindromic Substring.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Palindromic Substring.java) Java
81 [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) Java
82 [Longest Substring Without Repeating Characters.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Substring Without Repeating Characters.java) Java
83 [Longest Words.java](https://github.com/shawnfan/LintCode/blob/master/Java/Longest Words.java) Java
84 [Lowest Common Ancestor.java](https://github.com/shawnfan/LintCode/blob/master/Java/Lowest Common Ancestor.java) Java
85 [Majority Number II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Majority Number II.java) Java
86 [Majority Number III.java](https://github.com/shawnfan/LintCode/blob/master/Java/Majority Number III.java) Java
87 [Majority Number.java](https://github.com/shawnfan/LintCode/blob/master/Java/Majority Number.java) Java
88 [Max Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Max Tree.java) Java
89 [Maximal Square.java](https://github.com/shawnfan/LintCode/blob/master/Java/Maximal Square.java) Java
90 [Maximum Depth of Binary Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Maximum Depth of Binary Tree.java) Java
91 [Maximum Product Subarray.java](https://github.com/shawnfan/LintCode/blob/master/Java/Maximum Product Subarray.java) Java
92 MaximumSubarray.java Java
93 MaximumSubarrayII.java Java
94 Median.java Java
95 [Merge Intervals.java](https://github.com/shawnfan/LintCode/blob/master/Java/Merge Intervals.java) Java
96 [Merge k Sorted Lists.java](https://github.com/shawnfan/LintCode/blob/master/Java/Merge k Sorted Lists.java) Java
97 [Merge Sorted Array II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Merge Sorted Array II.java) Java
98 [Merge Sorted Array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Merge Sorted Array.java) Java
99 [Merge Two Sorted List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Merge Two Sorted List.java) Java
100 [Min Stack.java](https://github.com/shawnfan/LintCode/blob/master/Java/Min Stack.java) Java
101 [Minimum Path Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Minimum Path Sum.java) Java
102 [Minimum Size Subarray Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Minimum Size Subarray Sum.java) Java
103 [Minimum Subarray.java](https://github.com/shawnfan/LintCode/blob/master/Java/Minimum Subarray.java) Java
104 [Minimum Window Substring.java](https://github.com/shawnfan/LintCode/blob/master/Java/Minimum Window Substring.java) Java
105 MinimumDepthOfBinaryTree.java Java
106 [Next Permutation.java](https://github.com/shawnfan/LintCode/blob/master/Java/Next Permutation.java) Java
107 NQueens.java Java
108 NQueensII.java Java
109 [Nth to Last Node in List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Nth to Last Node in List.java) Java
110 [Number of Airplane in the sky.java](https://github.com/shawnfan/LintCode/blob/master/Java/Number of Airplane in the sky.java) Java
111 [Number of Islands II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Number of Islands II.java) Java
112 [Number of Islands.java](https://github.com/shawnfan/LintCode/blob/master/Java/Number of Islands.java) Java
113 [Number Triangles.java](https://github.com/shawnfan/LintCode/blob/master/Java/Number Triangles.java) Java
114 [O(1) Check Power of 2.java](https://github.com/shawnfan/LintCode/blob/master/Java/O(1) Check Power of 2.java) Java
115 [Palindrome Partitioning II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Palindrome Partitioning II.java) Java
116 [Palindrome Partitioning.java](https://github.com/shawnfan/LintCode/blob/master/Java/Palindrome Partitioning.java) Java
117 [Partition Array by Odd and Even.java](https://github.com/shawnfan/LintCode/blob/master/Java/Partition Array by Odd and Even.java) Java
118 [Partition Array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Partition Array.java) Java
119 [Partition List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Partition List.java) Java
120 Permutations.java Java
121 [Plus One.java](https://github.com/shawnfan/LintCode/blob/master/Java/Plus One.java) Java
122 [Product of Array Exclude Itself.java](https://github.com/shawnfan/LintCode/blob/master/Java/Product of Array Exclude Itself.java) Java
123 [Recover rotated array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Recover rotated array.java) Java
124 Rehashing.java Java
125 [Remove Duplicates from Sorted Array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Remove Duplicates from Sorted Array.java) Java
126 [Remove Duplicates from Sorted List II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Remove Duplicates from Sorted List II.java) Java
127 [Remove Duplicates from Sorted List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Remove Duplicates from Sorted List.java) Java
128 [Remove Linked List Elements.java](https://github.com/shawnfan/LintCode/blob/master/Java/Remove Linked List Elements.java) Java
129 [Remove Node in Binary Search Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Remove Node in Binary Search Tree.java) Java
130 [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
131 [Reorder List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Reorder List.java) Java
132 [Reverse Integer.java](https://github.com/shawnfan/LintCode/blob/master/Java/Reverse Integer.java) Java
133 [Reverse Linked List II .java](https://github.com/shawnfan/LintCode/blob/master/Java/Reverse Linked List II .java) Java
134 [Reverse Words in a String.java](https://github.com/shawnfan/LintCode/blob/master/Java/Reverse Words in a String.java) Java
135 [Rotate List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Rotate List.java) Java
136 [Rotate String.java](https://github.com/shawnfan/LintCode/blob/master/Java/Rotate String.java) Java
137 [Search a 2D Matrix II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search a 2D Matrix II.java) Java
138 [Search a 2D Matrix.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search a 2D Matrix.java) Java
139 [Search for a Range.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search for a Range.java) Java
140 [Search Insert Position.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search Insert Position.java) Java
141 [Search Range in Binary Search Tree .java](https://github.com/shawnfan/LintCode/blob/master/Java/Search Range in Binary Search Tree .java) Java
142 [Search Rotated Sorted Array II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search Rotated Sorted Array II.java) Java
143 [Search Rotated Sorted Array.java](https://github.com/shawnfan/LintCode/blob/master/Java/Search Rotated Sorted Array.java) Java
144 [Segment Tree Build II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Segment Tree Build II.java) Java
145 [Segment Tree Build.java](https://github.com/shawnfan/LintCode/blob/master/Java/Segment Tree Build.java) Java
146 [Serilization and Deserialization Of Binary Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Serilization and Deserialization Of Binary Tree.java) Java
147 [Single Number II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Single Number II.java) Java
148 [Single Number III.java](https://github.com/shawnfan/LintCode/blob/master/Java/Single Number III.java) Java
149 [Single Number.java](https://github.com/shawnfan/LintCode/blob/master/Java/Single Number.java) Java
150 Singleton.java Java
151 [Sliding Window Maximum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sliding Window Maximum.java) Java
152 [Sliding Window Median.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sliding Window Median.java) Java
153 [Sort Color.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sort Color.java) Java
154 [Sort Colors II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sort Colors II.java) Java
155 [Sort Letters by Case.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sort Letters by Case.java) Java
156 [Sort List.java](https://github.com/shawnfan/LintCode/blob/master/Java/Sort List.java) Java
157 [Space Replacement.java](https://github.com/shawnfan/LintCode/blob/master/Java/Space Replacement.java) Java
158 Sqrt(x).java Java
159 [Stone Game.java](https://github.com/shawnfan/LintCode/blob/master/Java/Stone Game.java) Java
160 [String to Integer(atoi).java](https://github.com/shawnfan/LintCode/blob/master/Java/String to Integer(atoi).java) Java
161 StrStr.java Java
162 [Subarray Sum Closest.java](https://github.com/shawnfan/LintCode/blob/master/Java/Subarray Sum Closest.java) Java
163 [Subarray Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Subarray Sum.java) Java
164 Subset.java Java
165 Subtree.java Java
166 [The Smallest Difference.java](https://github.com/shawnfan/LintCode/blob/master/Java/The Smallest Difference.java) Java
167 [Topological Sorting.java](https://github.com/shawnfan/LintCode/blob/master/Java/Topological Sorting.java) Java
168 [Trailing Zeros.java](https://github.com/shawnfan/LintCode/blob/master/Java/Trailing Zeros.java) Java
169 [Trapping Rain Water II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Trapping Rain Water II.java) Java
170 [Trapping Rain Water.java](https://github.com/shawnfan/LintCode/blob/master/Java/Trapping Rain Water.java) Java
171 [Triangle Count.java](https://github.com/shawnfan/LintCode/blob/master/Java/Triangle Count.java) Java
172 [Two Lists Sum.java](https://github.com/shawnfan/LintCode/blob/master/Java/Two Lists Sum.java) Java
173 [Two Strings Are Anagrams.java](https://github.com/shawnfan/LintCode/blob/master/Java/Two Strings Are Anagrams.java) Java
174 [Two Sum II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Two Sum II.java) Java
175 [Ugly Number.java](https://github.com/shawnfan/LintCode/blob/master/Java/Ugly Number.java) Java
176 [Unique Binary Search Tree II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Binary Search Tree II.java) Java
177 [Unique Binary Search Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Binary Search Tree.java) Java
178 [Unique Path.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Path.java) Java
179 [Unique Paths II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Paths II.java) Java
180 [Unique Permutations.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Permutations.java) Java
181 [Unique Subset.java](https://github.com/shawnfan/LintCode/blob/master/Java/Unique Subset.java) Java
182 [Update Bits.java](https://github.com/shawnfan/LintCode/blob/master/Java/Update Bits.java) Java
183 [Valid Palindrome.java](https://github.com/shawnfan/LintCode/blob/master/Java/Valid Palindrome.java) Java
184 [Validate Binary Search Tree.java](https://github.com/shawnfan/LintCode/blob/master/Java/Validate Binary Search Tree.java) Java
185 [Wood Cut.java](https://github.com/shawnfan/LintCode/blob/master/Java/Wood Cut.java) Java
186 [Word Break.java](https://github.com/shawnfan/LintCode/blob/master/Java/Word Break.java) Java
187 [Word Ladder II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Word Ladder II.java) Java
188 [Word Ladder.java](https://github.com/shawnfan/LintCode/blob/master/Java/Word Ladder.java) Java
189 [Word Search II.java](https://github.com/shawnfan/LintCode/blob/master/Java/Word Search II.java) Java
190 [Word Search.java](https://github.com/shawnfan/LintCode/blob/master/Java/Word Search.java) Java

About

Java Solutions to problems on LintCode/LeetCode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors

Languages