LeetCode Solutions by illuz

February 28, 2016 · View on GitHub

Updating....

My stupid How to LeetCode.

This is my leetcode solution folder. :)
Language: C++/Java/Python/Sql/Shell Script

If there was something wrong, can contact me at iilluzen in google's email.


Leetcode Algorithms Problems
Leetcode Database Problems
Leetcode Shell Problems


Problems

There are 333 problems (54 problems for a fee).

I have solved 229 / 279 problems.=w=

#ProblemsSolutionsNote
001001.Two_SumJava Python C++      Notes
002002.Add_Two_NumbersC++ Python Java      Notes
003003.Longest_Substring_Without_Repeat...Java Python C++      Notes
004004.Median_of_Two_Sorted_ArraysJava Python C++      Notes
005005.Longest_Palindromic_SubstringJava Python C++      Notes
006006.ZigZag_ConversionC++ Python Java      Notes
007007.Reverse_IntegerC++ Python Java      Notes
008008.String_to_IntegerC++ Python Java      Notes
009009.Palindrome_NumberJava Python C++      Notes
010010.Regular_Expression_MatchingC++ Python Java      Notes
011011.Container_With_Most_WaterJava Python C++      Notes
012012.Integer_to_RomanJava Python C++      Notes
013013.Roman_to_IntegerJava Python C++      Notes
014014.Longest_Common_PrefixC++ Python Java      Notes
015015.3SumC++ Python Java      Notes
016016.3Sum_ClosestC++ Python Java      Notes
017017.Letter_Combinations_of_a_Phone_NumberC++ Python Java      Notes
018018.4SumC++ Python Java      Notes
019019.Remove_Nth_Node_From_End_of_List   Python C++      Notes
020020.Valid_ParenthesesC++ Python Java      Notes
021021.Merge_Two_Sorted_Lists   Python C++      Notes
022022.Generate_ParenthesesC++ Python Java      Notes
023023.Merge_k_Sorted_ListsJava Python C++      Notes
024024.Swap_Nodes_in_Pairs   Python C++      Notes
025025.Reverse_Nodes_in_k-Group     Java C++      Notes
026026.Remove_Duplicates_from_Sorted_Array          C++      Notes
027027.Remove_Element          C++      Notes
028028.Implement_strStr()   Python C++      Notes
029029.Divide_Two_Integers   Python C++      Notes
030030.Substring_with_Concatenation_of_...     C++ Java      Notes
031031.Next_Permutation   Python C++      Notes
032032.Longest_Valid_Parentheses          C++      Notes
033033.Search_in_Rotated_Sorted_Array          C++      Notes
034034.Search_for_a_Range     Java C++      Notes
035035.Search_Insert_Position          C++      Notes
036036.Valid_Sudoku          C++      Notes
037037.Sudoku_Solver          C++      Notes
038038.Count_and_Say   Python C++      Notes
039039.Combination_Sum          C++      Notes
040040.Combination_Sum_II          C++      Notes
041041.First_Missing_Positive          C++Coming soon
042042.Trapping_Rain_Water          C++Coming soon
043043.Multiply_Strings          C++Coming soon
044044.Wildcard_Matching          C++Coming soon
045045.Jump_Game_II          C++Coming soon
046046.Permutations          C++Coming soon
047047.Permutations_II          C++Coming soon
048048.Rotate_Image          C++Coming soon
049049.Anagrams          C++Coming soon
050050.Pow(x,_n)          C++Coming soon
051051.N-QueensC++ Python JavaComing soon
052052.N-Queens_IIC++ Python JavaComing soon
053053.Maximum_Subarray          C++Coming soon
054054.Spiral_Matrix          C++Coming soon
055055.Jump_Game          C++Coming soon
056056.Merge_Intervals          C++Coming soon
057057.Insert_Interval          C++Coming soon
058058.Length_of_Last_Word          C++Coming soon
059059.Spiral_Matrix_II          C++Coming soon
060060.Permutation_Sequence          C++Coming soon
061061.Rotate_List          C++Coming soon
062062.Unique_Paths          C++Coming soon
063063.Unique_Paths_II          C++Coming soon
064064.Minimum_Path_Sum          C++Coming soon
065065.Valid_NumberJava Python C++Coming soon
066066.Plus_One          C++Coming soon
067067.Add_Binary          C++Coming soon
068068.Text_JustificationC++ Python Java      Notes
069069.Sqrt(x)C++ Python JavaComing soon
070070.Climbing_Stairs          C++Coming soon
071071.Simplify_PathC++ Python JavaComing soon
072072.Edit_Distance          C++Coming soon
073073.Set_Matrix_Zeroes          C++Coming soon
074074.Search_a_2D_Matrix          C++Coming soon
075075.Sort_Colors          C++Coming soon
076076.Minimum_Window_Substring          C++      Notes
077077.Combinations          C++Coming soon
078078.SubsetsJava Python C++Coming soon
079079.Word_Search          C++Coming soon
080080.Remove_Duplicates_from_Sorted_Array_II          C++Coming soon
081081.Search_in_Rotated_Sorted_Array_II          C++Coming soon
082082.Remove_Duplicates_from_Sorted_List_II          C++Coming soon
083083.Remove_Duplicates_from_Sorted_List          C++Coming soon
084084.Largest_Rectangle_in_Histogram     Java C++      Notes
085085.Maximal_Rectangle     Java C++      Notes
086086.Partition_ListC++ Python JavaComing soon
087087.Scramble_StringC++ Python Java      Notes
088088.Merge_Sorted_Array          C++Coming soon
089089.Gray_CodeC++ Python JavaComing soon
090090.Subsets_IIC++ Python JavaComing soon
091091.Decode_WaysJava Python C++Coming soon
092092.Reverse_Linked_List_II          C++Coming soon
093093.Restore_IP_AddressesC++ Python Java      Notes
094094.Binary_Tree_Inorder_Traversal          C++Coming soon
095095.Unique_Binary_Search_Trees          C++      Notes
096096.Unique_Binary_Search_Trees_II          C++      Notes
097097.Interleaving_String     Java C++      Notes
098098.Validate_Binary_Search_TreeJava Python C++      Notes
099099.Recover_Binary_Search_Tree   Python C++      Notes
100100.Same_Tree          C++Coming soon
101101.Symmetric_Tree          C++Coming soon
102102.Binary_Tree_Level_Order_Traversal   Python C++      Notes
103103.Binary_Tree_Zigzag_Level_Order_Traversal   Python C++      Notes
104104.Maximum_Depth_of_Binary_Tree          C++Coming soon
105105.Construct_Binary_Tree_from_Preor...          C++      Notes
106106.Construct_Binary_Tree_from_Inord...          C++      Notes
107107.Binary_Tree_Level_Order_Traversal_II   Python C++      Notes
108108.Convert_Sorted_Array_to_Binary_S...          C++      Notes
109109.Convert_Sorted_List_to_Binary_Se...   Python C++      Notes
110110.Balanced_Binary_Tree          C++Coming soon
111111.Minimum_Depth_of_Binary_Tree          C++Coming soon
112112.Path_Sum          C++Coming soon
113113.Path_Sum_IIJava Python C++Coming soon
114114.Flatten_Binary_Tree_to_Linked_List     Java C++      Notes
115115.Distinct_Subsequences   Python C++      Notes
116116.Populating_Next_Right_Pointers_i...C++ Python JavaComing soon
117117.Populating_Next_Right_Pointers_i...C++ Python JavaComing soon
118118.Pascal's_Triangle          C++Coming soon
119119.Pascal's_Triangle_II          C++Coming soon
120120.TriangleJava Python C++Coming soon
121121.Best_Time_to_Buy_and_Sell_Stock   Python C++      Notes
122122.Best_Time_to_Buy_and_Sell_Stock_II   Python C++      Notes
123123.Best_Time_to_Buy_and_Sell_Stock_III   Python C++      Notes
124124.Binary_Tree_Maximum_Path_Sum   Python C++      Notes
125125.Valid_Palindrome          C++Coming soon
126126.Word_Ladder   Python C++      Notes
126126.Word_Ladder_II             Coming soon
127127.Word_Ladder             Coming soon
128128.Longest_Consecutive_Sequence             Coming soon
129129.Sum_Root_to_Leaf_Numbers          C++Coming soon
130130.Surrounded_Regions          C++      Notes
131131.Palindrome_Partitioning   Python C++      Notes
132132.Palindrome_Partitioning_II     C++ Java      Notes
133133.Clone_Graph          C++Coming soon
134134.Gas_Station          C++      Notes
135135.Candy             Coming soon
136136.Single_Number          C++      Notes
137137.Single_Number_II          C++Coming soon
138138.Copy_List_with_Random_PointerJava Python C++      Notes
139139.Word_Break   Python C++      Notes
140140.Word_Break_II             Coming soon
141141.Linked_List_Cycle          C++Coming soon
142142.Linked_List_Cycle_II             Coming soon
143143.Reorder_List          C++Coming soon
144144.Binary_Tree_Preorder_Traversal          C++Coming soon
145145.Binary_Tree_Postorder_Traversal          C++Coming soon
146146.LRU_Cache   Python C++      Notes
147147.Insertion_Sort_List          C++Coming soon
148148.Sort_List          C++      Notes
149149.Max_Points_on_a_Line             Coming soon
150150.Evaluate_Reverse_Polish_NotationJava Python C++      Notes
151151.Reverse_Words_in_a_StringC++ Python Java      Notes
152152.Maximum_Product_Subarray          C++Coming soon
153153.Find_Minimum_in_Rotated_Sorted_Array          C++      Notes
154154.Find_Minimum_in_Rotated_Sorted_Array_II   Python C++      Notes
155155.Min_Stack          C++      Notes
156156.Binary_Tree_Upside_Down $       Not Buy    Not Buy
157157.Read_N_Characters_Given_Read4 $       Not Buy    Not Buy
158158.Read_N_Characters_Given_Read4_II... $       Not Buy    Not Buy
159159.Longest_Substring_with_At_Most_T... $       Not Buy    Not Buy
160160.Intersection_of_Two_Linked_Lists          C++Coming soon
161161.One_Edit_Distance $       Not Buy    Not Buy
162162.Find_Peak_ElementC++ Python JavaComing soon
163163.Missing_Ranges $       Not Buy    Not Buy
164164.Maximum_Gap          C++      Notes
165165.Compare_Version_Numbers          C++Coming soon
166166.Fraction_to_Recurring_Decimal          C++      Notes
167167.Two_Sum_II_-_Input_array_is_sorted $       Not Buy    Not Buy
168168.Excel_Sheet_Column_TitleJava Python C++Coming soon
169169.Majority_ElementJava Python C++Coming soon
170170.Two_Sum_III_-_Data_structure_design $       Not Buy    Not Buy
171171.Excel_Sheet_Column_NumberJava Python C++Coming soon
172172.Factorial_Trailing_ZeroesJava Python C++Coming soon
173173.Binary_Search_Tree_Iterator   Python C++      Notes
174174.Dungeon_Game             Coming soon
175175.Combine_Two_Tables          SqlComing soon
176176.Second_Highest_Salary          SqlComing soon
177177.Nth_Highest_Salary          Sql      Notes
178178.Rank_Scores          Sql      Notes
179179.Largest_NumberJava Python C++Coming soon
180180.Consecutive_Numbers          Sql      Notes
181181.Employees_Earning_More_Than_Thei...          SqlComing soon
182182.Duplicate_Emails          SqlComing soon
183183.Customers_Who_Never_Order          Sql      Notes
184184.Department_Highest_Salary          Sql      Notes
186186.Reverse_Words_in_a_String_II $       Not Buy    Not Buy
187187.Repeated_DNA_SequencesC++ Python JavaComing soon
188188.Best_Time_to_Buy_and_Sell_Stock_IV          C++      Notes
189189.Rotate_Array          C++      Notes
190190.Reverse_BitsC++ Python Java      Notes
191191.Number_of_1_Bits     C++ Java      Notes
192192.Word_Frequency        Shell      Notes
193193.Valid_Phone_Numbers        Shell      Notes
194194.Transpose_File        Shell      Notes
195195.Tenth_Line        Shell      Notes
196196.Delete_Duplicate_Emails          SqlComing soon
197197.Rising_Temperature          Sql      Notes
198198.House_Robber          C++      Notes
199199.Binary_Tree_Right_Side_View   Python C++      Notes
200200.Number_of_Islands          C++      Notes
201201.Bitwise_AND_of_Numbers_Range   Python C++      Notes
202202.Happy_Number   Python C++      Notes
203203.Remove_Linked_List_ElementsC++ Python Java      Notes
204204.Count_Primes          C++Coming soon
205205.Isomorphic_Strings   Python C++      Notes
206206.Reverse_Linked_List          C++Coming soon
207207.Course_Schedule   Python C++      Notes
208208.Implement_Trie_(Prefix_Tree)          C++      Notes
209209.Minimum_Size_Subarray_Sum          C++Coming soon
210210.Course_Schedule_II   Python C++      Notes
211211.Add_and_Search_Word_-_Data_struc...             Coming soon
212212.Word_Search_II             Coming soon
213213.House_Robber_II             Coming soon
214214.Shortest_Palindrome             Coming soon
215215.Kth_Largest_Element_in_an_ArrayC++ Python Java      Notes
216216.Combination_Sum_III          C++      Notes
217217.Contains_Duplicate   Python C++      Notes
218218.The_Skyline_Problem             Coming soon
219219.Contains_Duplicate_II          C++      Notes
220220.Contains_Duplicate_III     C++ Java      Notes
221221.Maximal_Square   Python C++      Notes
222222.Count_Complete_Tree_Nodes   Python C++      Notes
223223.Rectangle_Area          C++      Notes
224224.Basic_Calculator     Java C++      Notes
225225.Implement_Stack_using_Queues     Java C++      Notes
226226.Invert_Binary_Tree   Python C++      Notes
227227.Basic_Calculator_II             Coming soon
228228.Summary_Ranges   Python C++      Notes
229229.Majority_Element_II             Coming soon
230230.Kth_Smallest_Element_in_a_BST          C++      Notes
231231.Power_of_Two   Python C++      Notes
232232.Implement_Queue_using_Stacks   Python C++      Notes
233233.Number_of_Digit_One             Coming soon
234234.Palindrome_Linked_ListJava Python C++      Notes
235235.Lowest_Common_Ancestor_of_a_Bina...   Python C++      Notes
236236.Lowest_Common_Ancestor_of_a_Binary_Tree             Coming soon
237237.Delete_Node_in_a_Linked_List   Python C++      Notes
238238.Product_of_Array_Except_SelfJava Python C++      Notes
239239.Sliding_Window_Maximum   Python C++      Notes
240240.Search_a_2D_Matrix_II             Coming soon
241241.Different_Ways_to_Add_Parentheses   Python C++      Notes
242242.Valid_Anagram   Python C++      Notes
243243.Shortest_Word_Distance $       Not Buy    Not Buy
244244.Shortest_Word_Distance_II $       Not Buy    Not Buy
245245.Shortest_Word_Distance_III $       Not Buy    Not Buy
246246.Strobogrammatic_Number $       Not Buy    Not Buy
247247.Strobogrammatic_Number_II $       Not Buy    Not Buy
248248.Strobogrammatic_Number_III $       Not Buy    Not Buy
249249.Group_Shifted_Strings $       Not Buy    Not Buy
250250.Count_Univalue_Subtrees $       Not Buy    Not Buy
251251.Flatten_2D_Vector $       Not Buy    Not Buy
252252.Meeting_Rooms $       Not Buy    Not Buy
253253.Meeting_Rooms_II $       Not Buy    Not Buy
254254.Factor_Combinations $       Not Buy    Not Buy
255255.Verify_Preorder_Sequence_in_Bina... $       Not Buy    Not Buy
256256.Paint_House $       Not Buy    Not Buy
257257.Binary_Tree_Paths   Python C++      Notes
258258.Add_Digits   Python C++      Notes
259259.3Sum_Smaller $       Not Buy    Not Buy
260260.Single_Number_III             Coming soon
261261.Graph_Valid_Tree $       Not Buy    Not Buy
263263.Ugly_Number   Python C++      Notes
264264.Ugly_Number_II             Coming soon
265265.Paint_House_II $       Not Buy    Not Buy
266266.Palindrome_Permutation $       Not Buy    Not Buy
267267.Palindrome_Permutation_II $       Not Buy    Not Buy
268268.Missing_NumberC++ Python Java      Notes
269269.Alien_Dictionary $       Not Buy    Not Buy
270270.Closest_Binary_Search_Tree_Value $       Not Buy    Not Buy
271271.Encode_and_Decode_Strings $       Not Buy    Not Buy
272272.Closest_Binary_Search_Tree_Value_II $       Not Buy    Not Buy
273273.Integer_to_English_Words             Coming soon
274274.H-Index             Coming soon
275275.H-Index_II             Coming soon
276276.Paint_Fence $       Not Buy    Not Buy
277277.Find_the_Celebrity $       Not Buy    Not Buy
278278.First_Bad_Version   Python C++      Notes
279279.Perfect_Squares   Python C++      Notes
280280.Wiggle_Sort $       Not Buy    Not Buy
281281.Zigzag_Iterator $       Not Buy    Not Buy
282282.Expression_Add_Operators             Coming soon
283283.Move_Zeroes          C++      Notes
284284.Peeking_Iterator             Coming soon
285285.Inorder_Successor_in_BST $       Not Buy    Not Buy
286286.Walls_and_Gates $       Not Buy    Not Buy
287287.Find_the_Duplicate_Number             Coming soon
288288.Unique_Word_Abbreviation $       Not Buy    Not Buy
289289.Game_of_Life   Python C++      Notes
290290.Word_Pattern   Python C++      Notes
291291.Word_Pattern_II $       Not Buy    Not Buy
292292.Nim_Game          C++      Notes
293293.Flip_Game $       Not Buy    Not Buy
294294.Flip_Game_II $       Not Buy    Not Buy
295295.Find_Median_from_Data_Stream             Coming soon
296296.Best_Meeting_Point $       Not Buy    Not Buy
297297.Serialize_and_Deserialize_Binary_Tree             Coming soon
298298.Binary_Tree_Longest_Consecutive_Sequence $       Not Buy    Not Buy
299299.Bulls_and_Cows          C++Coming soon
300300.Longest_Increasing_Subsequence             Coming soon
301301.Remove_Invalid_Parentheses             Coming soon
302302.Smallest_Rectangle_Enclosing_Bla... $       Not Buy    Not Buy
303303.Range_Sum_Query_-_Immutable             Coming soon
304304.Range_Sum_Query_2D_-_Immutable             Coming soon
305305.Number_of_Islands_II $       Not Buy    Not Buy
306306.Additive_Number             Coming soon
307307.Range_Sum_Query_-_Mutable             Coming soon
308308.Range_Sum_Query_2D_-_Mutable $       Not Buy    Not Buy
309309.Best_Time_to_Buy_and_Sell_Stock_...             Coming soon
310310.Minimum_Height_Trees             Coming soon
311311.Sparse_Matrix_Multiplication $       Not Buy    Not Buy
312312.Burst_Balloons             Coming soon
313313.Super_Ugly_Number             Coming soon
314314.Binary_Tree_Vertical_Order_Traversal $       Not Buy    Not Buy
315315.Count_of_Smaller_Numbers_After_Self             Coming soon
316316.Remove_Duplicate_Letters             Coming soon
317317.Shortest_Distance_from_All_Buildings $       Not Buy    Not Buy
318318.Maximum_Product_of_Word_Lengths             Coming soon
319319.Bulb_Switcher             Coming soon
320320.Generalized_Abbreviation $       Not Buy    Not Buy
321321.Create_Maximum_Number             Coming soon
322322.Coin_Change             Coming soon
323323.Number_of_Connected_Components_i... $       Not Buy    Not Buy
324324.Wiggle_Sort_II             Coming soon
325325.Maximum_Size_Subarray_Sum_Equals_k $       Not Buy    Not Buy
326326.Power_of_ThreeC++ Python Java      Notes
327327.Count_of_Range_Sum             Coming soon
328328.Odd_Even_Linked_List   Python C++      Notes
329329.Longest_Increasing_Path_in_a_Matrix             Coming soon
330330.Patching_Array             Coming soon
331331.Verify_Preorder_Serialization_of...             Coming soon
332332.Reconstruct_Itinerary             Coming soon
333333.Largest_BST_Subtree $       Not Buy    Not Buy
334334.Increasing_Triplet_Subsequence          C++      Notes