Skip to content

Latest commit

 

History

History
219 lines (215 loc) · 43.6 KB

README.md

File metadata and controls

219 lines (215 loc) · 43.6 KB

LeetCode Solution

Solutions are written in Golang or Java.

Here are the result: (higher is better, max at 100)

difficulty total runtime beat(avg) memory beat(avg)
Easy 102 87.21 49.63
Medium 93 73.99 46.39
Hard 9 37.05 53.38
Total 204 78.97 48.32
id title difficulty runtime beat memory beat lang/ code
1 Two Sum Easy 96.22 48.53 Go
1 Two Sum Easy 98.93 38.10 Java
2 Add Two Numbers Medium 79.53 42.10 Java
3 Longest Substring Without Repeating Characters Medium 65.68 36.40 Java
4 Median of Two Sorted Arrays Hard 99.97 46.60 Java
5 Longest Palindromic Substring Medium 93.56 81.55 Go
7 Reverse Integer Medium 100.00 56.43 Go
7 Reverse Integer Medium 24.62 33.90 Java
9 Palindrome Number Easy 85.17 100.00 Go
11 Container With Most Water Medium 95.43 94.87 Java
13 Roman to Integer Easy 97.07 100.00 Go
13 Roman to Integer Easy 59.18 36.10 Java
14 Longest Common Prefix Easy 40.73 37.18 Go
14 Longest Common Prefix Easy 74.39 35.80 Java
17 Letter Combinations of a Phone Number Medium 59.45 35.80 Java
19 Remove Nth Node From End of List Medium 100.00 73.24 Go
19 Remove Nth Node From End of List Medium 100.00 34.90 Java
20 Valid Parentheses Easy 100.00 98.86 Go
20 Valid Parentheses Easy 98.86 34.10 Java
21 Merge Two Sorted Lists Easy 22.11 8.08 Java
22 Generate Parentheses Medium 94.68 36.20 Java
26 Remove Duplicates from Sorted Array Easy 93.75 100.00 Go
26 Remove Duplicates from Sorted Array Easy 97.79 41.10 Java
27 Remove Element Easy 100.00 36.20 Java
28 Find the Index of the First Occurrence in a String Medium 100.00 47.07 Go
28 Find the Index of the First Occurrence in a String Medium 5.64 37.30 Java
33 Search in Rotated Sorted Array Medium 100.00 40.20 Java
34 Find First and Last Position of Element in Sorted Array Medium 14.89 43.70 Java
35 Search Insert Position Easy 100.00 100.00 Java
36 Valid Sudoku Medium 70.89 43.90 Java
38 Count and Say Medium 29.42 36.40 Java
41 First Missing Positive Hard 37.60 35.90 Java
42 Trapping Rain Water Hard 5.71 38.70 Java
46 Permutations Medium 97.03 37.30 Java
48 Rotate Image Medium 100.00 36.10 Java
49 Group Anagrams Medium 31.73 40.90 Java
53 Maximum Subarray Medium 99.65 99.39 Go
54 Spiral Matrix Medium 57.99 61.07 Go
55 Jump Game Medium 99.09 40.80 Java
56 Merge Intervals Medium 80.15 61.34 Go
62 Unique Paths Medium 100.00 32.90 Java
66 Plus One Easy 100.00 35.20 Java
69 Sqrt(x) Easy 100.00 33.40 Java
70 Climbing Stairs Easy 100.00 78.18 Go
70 Climbing Stairs Easy 100.00 5.26 Java
73 Set Matrix Zeroes Medium 17.29 49.80 Java
75 Sort Colors Medium 100.00 35.30 Java
78 Subsets Medium 5.09 37.60 Java
84 Largest Rectangle in Histogram Hard 21.90 75.00 Java
88 Merge Sorted Array Easy 67.89 53.27 Go
88 Merge Sorted Array Easy 100.00 36.30 Java
91 Decode Ways Medium 98.53 34.30 Java
94 Binary Tree Inorder Traversal Easy 100.00 34.70 Java
98 Validate Binary Search Tree Medium 7.25 39.90 Java
101 Symmetric Tree Easy 100.00 39.40 Java
102 Binary Tree Level Order Traversal Medium 100.00 36.10 Java
103 Binary Tree Zigzag Level Order Traversal Medium 92.68 36.30 Java
104 Maximum Depth of Binary Tree Easy 89.41 60.14 Go
104 Maximum Depth of Binary Tree Easy 100.00 94.62 Java
105 Construct Binary Tree from Preorder and Inorder Traversal Medium 45.14 36.20 Java
106 Construct Binary Tree from Inorder and Postorder Traversal Medium 38.33 36.20 Java
108 Convert Sorted Array to Binary Search Tree Easy 100.00 37.30 Java
116 Populating Next Right Pointers in Each Node Medium 22.18 37.90 Java
118 Pascal's Triangle Easy 100.00 14.91 Go
118 Pascal's Triangle Easy 100.00 7.23 Java
120 Triangle Medium 30.93 36.70 Java
121 Best Time to Buy and Sell Stock Easy 96.22 29.82 Go
121 Best Time to Buy and Sell Stock Easy 79.37 100.00 Java
122 Best Time to Buy and Sell Stock II Medium 91.86 36.90 Java
124 Binary Tree Maximum Path Sum Hard 99.80 98.81 Java
125 Valid Palindrome Easy 100.00 93.03 Go
125 Valid Palindrome Easy 56.06 37.50 Java
127 Word Ladder Hard 21.82 38.60 Java
128 Longest Consecutive Sequence Medium 5.00 39.80 Java
130 Surrounded Regions Medium 17.47 40.60 Java
134 Gas Station Medium 100.00 37.80 Java
136 Single Number Easy 100.00 39.20 Java
138 Copy List with Random Pointer Medium 74.63 35.50 Java
139 Word Break Medium 99.58 35.60 Java
141 Linked List Cycle Easy 6.73 38.80 Java
146 LRU Cache Medium 75.89 56.40 Java
148 Sort List Medium 5.03 94.74 Java
150 Evaluate Reverse Polish Notation Medium 79.58 37.80 Java
155 Min Stack Medium 95.40 65.30 Go
155 Min Stack Medium 89.12 40.20 Java
160 Intersection of Two Linked Lists Easy 13.81 38.70 Java
162 Find Peak Element Medium 100.00 37.60 Java
169 Majority Element Easy 46.06 39.90 Java
171 Excel Sheet Column Number Easy 5.73 100.00 Java
172 Factorial Trailing Zeroes Medium 100.00 33.50 Java
179 Largest Number Medium 47.12 36.20 Java
189 Rotate Array Medium 52.39 37.50 Java
190 Reverse Bits Easy 100.00 99.43 Go
190 Reverse Bits Easy 100.00 29.70 Java
191 Number of 1 Bits Easy 100.00 74.84 Go
191 Number of 1 Bits Easy 100.00 33.40 Java
198 House Robber Medium 100.00 100.00 Go
198 House Robber Medium 100.00 34.20 Java
200 Number of Islands Medium 100.00 40.70 Java
202 Happy Number Easy 63.75 33.70 Java
204 Count Primes Medium 65.27 50.30 Go
204 Count Primes Medium 70.90 34.50 Java
206 Reverse Linked List Easy 100.00 37.20 Java
208 Implement Trie (Prefix Tree) Medium 76.72 52.90 Java
215 Kth Largest Element in an Array Medium 53.27 52.33 Java
217 Contains Duplicate Easy 57.49 43.80 Java
219 Contains Duplicate II Easy 88.07 43.51 Go
230 Kth Smallest Element in a BST Medium 73.05 37.40 Java
234 Palindrome Linked List Easy 39.47 40.40 Java
236 Lowest Common Ancestor of a Binary Tree Medium 77.68 34.30 Java
237 Delete Node in a Linked List Medium 100.00 100.00 Go
237 Delete Node in a Linked List Medium 100.00 36.20 Java
238 Product of Array Except Self Medium 13.24 42.50 Java
239 Sliding Window Maximum Hard 23.60 40.80 Java
240 Search a 2D Matrix II Medium 100.00 42.50 Java
242 Valid Anagram Easy 100.00 100.00 Go
242 Valid Anagram Easy 79.98 36.30 Java
268 Missing Number Easy 97.20 54.76 Go
268 Missing Number Easy 100.00 38.80 Java
278 First Bad Version Easy 100.00 66.86 Go
279 Perfect Squares Medium 93.71 35.40 Java
283 Move Zeroes Easy 100.00 37.90 Java
287 Find the Duplicate Number Medium 27.12 36.70 Java
289 Game of Life Medium 100.00 34.60 Java
295 Find Median from Data Stream Hard 6.42 67.10 Java
300 Longest Increasing Subsequence Medium 64.56 36.90 Java
315 Count of Smaller Numbers After Self Hard 16.59 38.90 Java
322 Coin Change Medium 84.99 94.67 Java
326 Power of Three Easy 84.01 100.00 Go
326 Power of Three Easy 80.68 35.60 Java
328 Odd Even Linked List Medium 100.00 36.30 Java
334 Increasing Triplet Subsequence Medium 100.00 38.60 Java
341 Flatten Nested List Iterator Medium 69.50 37.20 Java
344 Reverse String Easy 83.46 86.51 Go
344 Reverse String Easy 100.00 51.20 Java
347 Top K Frequent Elements Medium 32.13 40.80 Java
349 Intersection of Two Arrays Easy 37.05 37.50 Java
350 Intersection of Two Arrays II Easy 93.37 37.60 Java
371 Sum of Two Integers Medium 100.00 32.80 Java
378 Kth Smallest Element in a Sorted Matrix Medium 39.29 70.27 Java
380 Insert Delete GetRandom O(1) Medium 58.14 46.80 Java
384 Shuffle an Array Medium 87.41 54.81 Go
384 Shuffle an Array Medium 9.71 61.30 Java
387 First Unique Character in a String Easy 89.98 68.67 Go
387 First Unique Character in a String Easy 60.56 38.40 Java
412 Fizz Buzz Easy 92.66 99.88 Go
429 N-ary Tree Level Order Traversal Medium 99.97 40.50 Java
454 4Sum II Medium 43.70 12.00 Java
461 Hamming Distance Easy 45.05 72.97 Go
495 Teemo Attacking Easy 78.38 32.43 Go
509 Fibonacci Number Easy 100.00 33.10 Java
535 Encode and Decode TinyURL Medium 100.00 100.00 Java
557 Reverse Words in a String III Easy 83.82 37.90 Java
559 Maximum Depth of N-ary Tree Easy 100.00 38.60 Java
561 Array Partition Easy 92.74 39.10 Java
589 N-ary Tree Preorder Traversal Easy 98.44 40.30 Java
590 N-ary Tree Postorder Traversal Easy 98.37 39.50 Java
617 Merge Two Binary Trees Easy 100.00 100.00 Java
654 Maximum Binary Tree Medium 100.00 37.80 Java
657 Robot Return to Origin Easy 97.92 37.80 Java
700 Search in a Binary Search Tree Easy 100.00 38.40 Java
701 Insert into a Binary Search Tree Medium 100.00 39.10 Java
709 To Lower Case Easy 100.00 34.10 Java
728 Self Dividing Numbers Easy 73.44 33.90 Java
771 Jewels and Stones Easy 94.30 34.60 Java
804 Unique Morse Code Words Easy 100.00 35.60 Java
807 Max Increase to Keep City Skyline Medium 100.00 43.90 Java
811 Subdomain Visit Count Medium 82.69 37.10 Java
814 Binary Tree Pruning Medium 100.00 34.60 Java
821 Shortest Distance to a Character Easy 99.14 36.40 Java
832 Flipping an Image Easy 100.00 37.30 Java
852 Peak Index in a Mountain Array Medium 100.00 38.40 Java
861 Score After Flipping Matrix Medium 100.00 37.70 Java
876 Middle of the Linked List Easy 100.00 34.10 Java
883 Projection Area of 3D Shapes Easy 100.00 42.50 Java
890 Find and Replace Pattern Medium 94.38 36.30 Java
897 Increasing Order Search Tree Easy 100.00 43.80 Java
905 Sort Array By Parity Easy 100.00 39.90 Java
918 Maximum Sum Circular Subarray Medium 87.92 69.08 Go
921 Minimum Add to Make Parentheses Valid Medium 100.00 34.10 Java
922 Sort Array By Parity II Easy 99.66 41.60 Java
929 Unique Email Addresses Easy 96.92 38.10 Java
938 Range Sum of BST Easy 100.00 45.20 Java
961 N-Repeated Element in Size 2N Array Easy 100.00 38.50 Java
965 Univalued Binary Tree Easy 100.00 34.40 Java
977 Squares of a Sorted Array Easy 69.25 40.20 Java
1002 Find Common Characters Easy 100.00 100.00 Java
1008 Construct Binary Search Tree from Preorder Traversal Medium 100.00 35.90 Java
1021 Remove Outermost Parentheses Easy 98.15 37.20 Java
1038 Binary Search Tree to Greater Sum Tree Medium 100.00 100.00 Java
1047 Remove All Adjacent Duplicates In String Easy 71.81 37.20 Java
1051 Height Checker Easy 87.78 34.70 Java
1108 Defanging an IP Address Easy 100.00 100.00 Java
1122 Relative Sort Array Easy 100.00 36.20 Java
1160 Find Words That Can Be Formed by Characters Easy 96.79 36.90 Java
1207 Unique Number of Occurrences Easy 88.45 35.50 Java
1221 Split a String in Balanced Strings Easy 100.00 33.80 Java
1252 Cells with Odd Values in a Matrix Easy 90.64 35.80 Java
1266 Minimum Time Visiting All Points Easy 84.70 43.10 Java
1281 Subtract the Product and Sum of Digits of an Integer Easy 100.00 32.90 Java
1282 Group the People Given the Group Size They Belong To Medium 86.10 37.40 Java
1295 Find Numbers with Even Number of Digits Easy 98.57 38.80 Java
1614 Maximum Nesting Depth of the Parentheses Easy 100.00 63.77 Go
2248 Intersection of Multiple Arrays Easy 78.26 89.13 Go