This is for the record. --- Captain Price
Some of the codes are from Internet. Please let me know if you uncomfortable that I cited your code.
I will add "cite from xxxx's blog" after commit 5c12d182238be056fd2ca6c98adeacdee1f254ed if I have refered somebody's code.
Happy coding Happy Life.
Discussions are welcomed.
Update Jan/19: I'm starting add C++ solution.
Update Feb/11: I'm starting add Java Solution. FOR EXPEDIA!
Update Aug/16: I'm continuing my work. For fun.
# | Title | Solution |
---|---|---|
0 | ----- | Solution |
1 | Two Sum | Solution |
2 | Add Two Numbers | Solution |
3 | Longest Substring Without Repeating Characters | Solution |
5 | Longest Palindrome Substring | Solution |
6 | ZigZag Conversion | Solution |
7 | Reverse Integer | Solution |
8 | String To Integer | Solution |
9 | Palindrome Number | Solution |
11 | Container With Most Water | Solution |
12 | Integer To Roman | Solution |
13 | Roman To Integer | Solution |
14 | Longest Common Prefix | Solution |
15 | 3Sum | Solution |
16 | 3Sum Closest | Solution |
17 | Letter Combinations Of A Phone Number | Solution |
18 | 4Sum | Solution |
19 | Remove Nth Node From End Of List | Solution |
20 | Valid Parentheses | Solution |
21 | Merge Two Sorted Lists | Solution |
22 | Generate Parentheses | Solution |
24 | Swap Nodes In Pairs | Solution |
25 | Reverse Nodes In K Group | Solution |
26 | Remove Duplicates From Sorted Array | Solution |
27 | Remove Element | Solution |
28 | Implement strStr() | Solution |
29 | Divide Two Integers | Solution |
31 | Next Permutation | Solution |
33 | Search In Rotated Sorted Array | Solution |
34 | Search For A Range | Solution |
35 | Search Insert Position | Solution |
36 | Valid Sudoku | Solution |
37 | Sudoku Solver | Solution |
38 | Count And Say | Solution |
39 | Combination Sum | Solution |
40 | Combination Sum II | Solution |
42 | Trapping Rain Water | Solution |
43 | Multiply Strings | Solution |
46 | Permutations | Solution |
47 | Permutations II | Solution |
48 | Rotate Image | Solution |
49 | Group Anagrams | Solution |
50 | Pow(x,n) | Solution |
51 | NQueens | Solution |
53 | Maximum Subarray | Solution |
54 | Spiral Matrix | Solution |
55 | Jump Game | Solution |
56 | Merge Intervals | Solution |
57 | Insert Interval | Solution |
58 | Length Of Last Word | Solution |
59 | Spiral Matrix II | Solution |
60 | Permutation Sequence | Solution |
61 | Rotate List | Solution |
62 | Unique Paths | Solution |
63 | Unique Paths II | Solution |
64 | Minimum Path Sum | Solution |
67 | Add Binary | Solution |
69 | Sqrt(x) | Solution |
70 | Climbing Stairs | Solution |
71 | Simplify Path | Solution |
72 | Edit Distance | Solution |
73 | Set Matrix Zeroes | Solution |
74 | Search A 2D Matrix | Solution |
75 | Sort Colors | Solution |
76 | Minimum Window String | Solution |
77 | Combinations | Solution |
78 | Subsets | Solution |
79 | Word Search | Solution |
80 | Remove Duplicates From Sorted Array II | Solution |
81 | Search In Rotated Sorted Array II | Solution |
82 | Remove Duplicates From Sorted List II | Solution |
83 | Remove Duplicates From Sorted List | Solution |
86 | Partition List | Solution |
88 | Merge Sorted Array | Solution |
89 | Gray Code | Solution |
90 | Subsets II | Solution |
91 | Decode Ways | Solution |
92 | Reverse Linked List II | Solution |
93 | Restore IP Addresses | Solution |
94 | Binary Tree Inorder Traversal | Solution |
95 | Unique Binary Search Trees II | Solution |
96 | Unique Binary Search Trees | Solution |
97 | Interleaving String | Solution |
98 | Validate Binary Search Tree | Solution |
100 | Same Tree | Solution |
101 | Symmetric Tree | Solution |
102 | Binary Tree Level Order Traversal | Solution |
103 | Binary Tree Zigzag Level Order Traversal | Solution |
104 | Maximum Depth Of Binary Tree | Solution |
105 | Construct Binary Tree from Preorder and Inorder Traversal | Solution |
106 | Construct Binary Tree from Inorder and Postorder Traversal | Solution |
107 | Binary Tree Level Order Traversal II | Solution |
108 | Convert Sorted Array To Binary Search Tree | Solution |
109 | Convert Sorted List To Binary Search Tree | Solution |
110 | Balanced Binary Tree | Solution |
111 | Minimum Depth Of Binary Tree | Solution |
112 | Path Sum | Solution |
113 | Path Sum II | Solution |
114 | Flatten Binary Tree To Linked List | Solution |
115 | Distinct Subsequences | Solution |
116 | Populating Next Right Pointers In Each Node | Solution |
117 | Populating Next Right Pointers In Each Node II | Solution |
118 | Pascal's Triangle | Solution |
119 | Pascal's Triangle II | Solution |
120 | Triangle | Solution |
121 | Best Time To Buy And Sell Stock | Solution |
122 | Best Time To Buy And Sell Stock II | Solution |
123 | Best Time To Buy And Sell Stock III | Solution |
125 | Valid Palindrome | Solution |
127 | Word Ladder | Solution |
128 | Longest Consecutive Sequence | Solution |
129 | Sum Root To Leaf Numbers | Solution |
130 | Surrounded Regions | Solution |
131 | Palindrome Partitioning | Solution |
133 | Clone Graph | Solution |
134 | Gas Station | Solution |
136 | Single Number | Solution |
137 | Single Number II | Solution |
138 | Copy List With Random Pointer | Solution |
139 | Word Break | Solution |
141 | Linked List Cycle | Solution |
142 | Linked List Cycle II | Solution |
143 | Reorder List | Solution |
144 | Binary Tree Preorder Traversal | Solution |
147 | Insertion Sort List | Solution |
148 | Sort List | Solution |
150 | Evaluate Reverse Polish Notation | Solution |
151 | Reverse Words In A String | Solution |
152 | Maximum Product Subarray | Solution |
153 | Find Minimum In Rotated Sorted Array | Solution |
155 | Min Stack | Solution |
160 | Intersection Of Two Linked Lists | Solution |
162 | Find Peak Element | Solution |
165 | Compare Version Numbers | Solution |
166 | Fraction To Recurring Decimal | Solution |
168 | Excel Sheet Column Title | Solution |
169 | Majority Element | Solution |
171 | Excel Sheet Column Number | Solution |
172 | Factorial Trailing Zeroes | Solution |
173 | Binary Search Tree Iterator | Solution |
179 | Largest Number | Solution |
187 | Repeated DNA Sequences | Solution |
188 | Best Time To Buy And Sell Stock IV | Solution |
189 | Rotate Array | Solution |
190 | Reverse Bits | Solution |
191 | Number Of 1 Bits | Solution |
198 | House Robber | Solution |
199 | Binary Tree Right Side View | Solution |
200 | Number Of Islands | Solution |
201 | Bitwise AND of Numbers Range | Solution |
202 | Happy Number | Solution |
203 | Remove Linked List Elements | Solution |
204 | Count Primes | Solution |
205 | Isomorphic Strings | Solution |
206 | Reverse Linked List | Solution |
207 | Course Schedule | Solution |
208 | Implement Trie (Prefix Tree) | Solution |
209 | Minimum Size Subarray Sum | Solution |
210 | Course Schedule II | Solution |
211 | Add and Search Word - Data structure design | Solution |
213 | House Robber II | Solution |
215 | Kth Largest Element In An Array | Solution |
216 | Combination Sum III | Solution |
217 | Contains Duplicate | Solution |
219 | Contains Duplicate II | Solution |
220 | Contains Duplicate III | Solution |
221 | Maximal Square | Solution |
222 | Count Complete Tree Nodes | Solution |
223 | Rectangle Area | Solution |
224 | Basic Calculator | Solution |
225 | Implement Stack Using Queues | Solution |
226 | Invert Binary Tree | Solution |
227 | Basic Calculator II | Solution |
228 | Summary Ranges | Solution |
229 | Majority Element II | Solution |
230 | Kth Smallest Element In A BST | Solution |
231 | Power Of Two | Solution |
232 | Implement Queue Using Stacks | Solution |
233 | Number Of Digit One | Solution |
234 | Palindrome Linked List | Solution |
235 | Lowest Common Ancestor Of A Binary Search Tree | Solution |
236 | Lowest Common Ancestor Of A Binary Tree | Solution |
237 | Delete Node In A Linked List | Solution |
238 | Product Of Array Except Self | Solution |
239 | Sliding Window Maximum | Solution |
240 | Search A 2D Matrix II | Solution |
241 | Different Ways To Add Parentheses | Solution |
242 | Valid Anagram | Solution |
257 | Binary Tree Paths | Solution |
258 | Add Digits | Solution |
260 | Single Number III | Solution |
263 | Ugly Number | Solution |
264 | Ugly Number II | Solution |
268 | Missing Number | Solution |
273 | Integer To English Words | Solution |
274 | H-Index | Solution |
275 | H-Index II | Solution |
277 | Find The Celebrity | Solution |
278 | First Bad Version | Solution |
279 | Perfect Squares | Solution |
282 | Expression Add Operators | Solution |
283 | Move Zeroes | Solution |
284 | Peeking Iterator | Solution |
285 | Inorder Successor In BST | Solution |
287 | Find The Duplicate Number | Solution |
289 | Game Of Life | Solution |
290 | Word Pattern | Solution |
292 | Nim Game | Solution |
295 | Find Median From Data Stream | Solution |
297 | Serialize And Deserialize Binary Tree | Solution |
348 | Design Tic Tac Toe | Solution |
426 | Convert Binary Search Tree to Sorted Doubly Linked List | Solution |
443 | String Compression | Solution |
450 | Delete Node in A BST | Solution |
490 | The Maze | Solution |
784 | Letter Case Permutation | Solution |
1007 | Minimum Domino Rotations For Equal Row | Solution |