|
1 | 1 | #awesome-java-leetcode
|
2 | 2 |
|
3 |
| -我如今是一名AndroidDeveloper,大学的我曾是一名ACMer,我一直认为数据结构和算法是作为一名程序员必须掌握和善于利用的,为了不让数据结构和算法淡出我的记忆,所以我打算重拾LeetCode之Algorithm,语言选择的是Java,题库会一点点完善起来,按简单,中等,困难分类,相应难度下按题号排序,源代码在[src][src]目录中,相关解题都在[note][note]目录中,想要学习数据结构和算法或打算刷LeetCode的小伙伴们欢迎star哦。 |
| 3 | +我如今是一名 AndroidDeveloper,大学的我曾是一名 ACMer,我一直认为数据结构和算法是作为一名程序员必须掌握和善于利用的,为了不让数据结构和算法淡出我的记忆,所以我打算重拾 LeetCode 之 Algorithm,语言选择的是 Java,题库会一点点完善起来,按简单,中等,困难分类,相应难度下按题号排序,源代码在[src][src]目录中,相关解题都在[note][note]目录中,想要学习数据结构和算法或打算刷 LeetCode 的小伙伴们欢迎 star 哦。 |
4 | 4 |
|
5 |
| -如今有机会面试Facebook,附上LeetCode上Facebook的面试题目序号,希望可以帮助到以后想入Facebook的小伙伴:-) |
| 5 | +如今有机会面试 Facebook,附上 LeetCode 上 Facebook 的面试题目序号,希望可以帮助到以后想入 Facebook 的小伙伴:-) |
6 | 6 |
|
7 | 7 | ```
|
8 | 8 | 1,10,13,15,17,20,23,25,26,28,33,38,43,44,49,50,56,57,67,68,69,71,75,76
|
|
12 | 12 | 341,377,380,398,404,410,461,477,494,523,525,534,535,543,554
|
13 | 13 | ```
|
14 | 14 |
|
15 |
| -如果想知道更多公司LeetCode面试题,可以参看[Companies.md][companies]。 |
| 15 | +如果想知道更多公司 LeetCode 面试题,可以参看[Companies.md][companies]。 |
16 | 16 |
|
17 | 17 | 附上镇楼诗:
|
18 | 18 |
|
19 |
| ->明有科举八股,今有LeetCode。 |
20 |
| ->八股定格式而取文采心意,LeetCode定题目且重答案背诵。 |
| 19 | +>明有科举八股,今有 LeetCode。 |
| 20 | +>八股定格式而取文采心意,LeetCode 定题目且重答案背诵。 |
21 | 21 | >美其名曰:"practice makes perfect."
|
22 | 22 | >为何今不如古?
|
23 | 23 | >非也非也,
|
24 |
| ->科举为国取士,LeetCode为Google筛码工,各取所需也。 |
| 24 | +>科举为国取士,LeetCode 为 Google 筛码工,各取所需也。 |
25 | 25 |
|
26 | 26 |
|
27 | 27 | ##Easy
|
28 | 28 |
|
29 |
| -|#|Title|Tag| |
30 |
| -|:-------------|:-------------|:-------------| |
31 |
| -|1|[Two Sum][001]|Array, Hash Table| |
32 |
| -|7|[Reverse Integer][007]|Math| |
33 |
| -|9|[Palindrome Number][009]|Math| |
34 |
| -|13|[Roman to Integer][013]|Math, String| |
35 |
| -|14|[Longest Common Prefix][014]|String| |
36 |
| -|20|[Valid Parentheses][020]|Stack, String| |
37 |
| -|21|[Merge Two Sorted Lists][021]|Linked List| |
38 |
| -|26|[Remove Duplicates from Sorted Array][026]|Array, Two Pointers| |
39 |
| -|27|[Remove Element][027]|Array, Two Pointers| |
40 |
| -|28|[Implement strStr()][028]|Two Pointers, String| |
41 |
| -|35|[Search Insert Position][035]|String| |
42 |
| -|38|[Count and Say][038]|String| |
43 |
| -|53|[Maximum Subarray][053]|Array,Dynamic Programming,Divide and Conquer| |
44 |
| -|58|[Length of Last Word][058]|String| |
45 |
| -|66|[Plus One][066]|Array, Math| |
46 |
| -|67|[Add Binary][067]|Math, String| |
47 |
| -|69|[Sqrt(x)][069]|Binary Search, Math| |
48 |
| -|70|[Climbing Stairs][070]|Dynamic Programming| |
49 |
| -|83|[Remove Duplicates from Sorted List][083]|Linked List| |
50 |
| -|88|[Merge Sorted Array][088]|Array, Two Pointers| |
51 |
| -|100|[Same Tree][100]|Tree, Depth-first Search| |
52 |
| -|101|[Symmetric Tree][101]|Tree, Depth-first Search, Breadth-first Search| |
53 |
| -|104|[Maximum Depth of Binary Tree][104]|Tree, Depth-first Search| |
54 |
| -|107|[Binary Tree Level Order Traversal II][107]|Tree, Breadth-first Search| |
55 |
| -|108|[Convert Sorted Array to Binary Search Tree][108]|Tree, Depth-first Search| |
56 |
| -|110|[Balanced Binary Tree][110]|Tree, Depth-first Search| |
57 |
| -|111|[Minimum Depth of Binary Tree][111]|Tree, Depth-first Search, Breadth-first Search| |
58 |
| -|112|[Path Sum][112]|Tree, Depth-first Search| |
59 |
| -|118|[Pascal's Triangle][118]|Array| |
60 |
| -|119|[Pascal's Triangle II][119]|Array| |
61 |
| -|121|[Best Time to Buy and Sell Stock][121]|Array, Dynamic Programmin| |
62 |
| -|122|[Best Time to Buy and Sell Stock II][122]|Array, Greedy| |
63 |
| -|543|[Diameter of Binary Tree][543]|Tree| |
| 29 | +| #|Title|Tag| |
| 30 | +|:---| :---------------------------------------| :---------------------------------------| |
| 31 | +| 1|[Two Sum][001]|Array, Hash Table| |
| 32 | +| 7|[Reverse Integer][007]|Math| |
| 33 | +| 9|[Palindrome Number][009]|Math| |
| 34 | +| 13|[Roman to Integer][013]|Math, String| |
| 35 | +| 14|[Longest Common Prefix][014]|String| |
| 36 | +| 20|[Valid Parentheses][020]|Stack, String| |
| 37 | +| 21|[Merge Two Sorted Lists][021]|Linked List| |
| 38 | +| 26|[Remove Duplicates from Sorted Array][026]|Array, Two Pointers| |
| 39 | +| 27|[Remove Element][027]|Array, Two Pointers| |
| 40 | +| 28|[Implement strStr()][028]|Two Pointers, String| |
| 41 | +| 35|[Search Insert Position][035]|String| |
| 42 | +| 38|[Count and Say][038]|String| |
| 43 | +| 53|[Maximum Subarray][053]|Array, Divide and Conquer, Dynamic Programming| |
| 44 | +| 58|[Length of Last Word][058]|String| |
| 45 | +| 66|[Plus One][066]|Array, Math| |
| 46 | +| 67|[Add Binary][067]|Math, String| |
| 47 | +| 69|[Sqrt(x)][069]|Binary Search, Math| |
| 48 | +| 70|[Climbing Stairs][070]|Dynamic Programming| |
| 49 | +| 83|[Remove Duplicates from Sorted List][083]|Linked List| |
| 50 | +| 88|[Merge Sorted Array][088]|Array, Two Pointers| |
| 51 | +|100|[Same Tree][100]|Tree, Depth-first Search| |
| 52 | +|101|[Symmetric Tree][101]|Tree, Depth-first Search, Breadth-first Search| |
| 53 | +|104|[Maximum Depth of Binary Tree][104]|Tree, Depth-first Search| |
| 54 | +|107|[Binary Tree Level Order Traversal II][107]|Tree, Breadth-first Search| |
| 55 | +|108|[Convert Sorted Array to Binary Search Tree][108]|Tree, Depth-first Search| |
| 56 | +|110|[Balanced Binary Tree][110]|Tree, Depth-first Search| |
| 57 | +|111|[Minimum Depth of Binary Tree][111]|Tree, Depth-first Search, Breadth-first Search| |
| 58 | +|112|[Path Sum][112]|Tree, Depth-first Search| |
| 59 | +|118|[Pascal's Triangle][118]|Array| |
| 60 | +|119|[Pascal's Triangle II][119]|Array| |
| 61 | +|121|[Best Time to Buy and Sell Stock][121]|Array, Dynamic Programmin| |
| 62 | +|122|[Best Time to Buy and Sell Stock II][122]|Array, Greedy| |
| 63 | +|543|[Diameter of Binary Tree][543]|Tree| |
64 | 64 |
|
65 | 65 |
|
66 | 66 | ##Medium
|
67 | 67 |
|
68 |
| -|#|Title|Tag| |
69 |
| -|:-------------|:-------------|:-------------| |
70 |
| -|2|[Add Two Numbers][002]|Linked List, Math| |
71 |
| -|3|[Longest Substring Without Repeating Characters][003]|Hash Table, Two Pointers, String| |
72 |
| -|8|[String to Integer (atoi)][008]|Math, String| |
73 |
| -|15|[3Sum][015]|Array, Two Pointers| |
74 |
| -|17|[Letter Combinations of a Phone Number][017]|String, Backtracking| |
75 |
| -|19|[Remove Nth Node From End of List][019]|Linked List, Two Pointers| |
76 |
| -|33|[Search in Rotated Sorted Array][033]|Arrays, Binary Search| |
77 |
| -|43|[Multiply Strings][043]|Math, String| |
78 |
| -|49|[Group Anagrams][049]|Hash Table, String| |
79 |
| -|50|[Pow(x, n)][050]|Math, Binary Search| |
80 |
| -|56|[Merge Intervals][056]|Array, Sort| |
81 |
| -|554|[Brick Wall][554]|Hash Table| |
| 68 | +| #| Title| Tag| |
| 69 | +| :---| :---------------------------------------| :-------------------------------| |
| 70 | +| 2|[Add Two Numbers][002]| Linked List, Math| |
| 71 | +| 3|[Longest Substring Without Repeating Characters][003]| Hash Table, Two Pointers, String| |
| 72 | +| 5|[Longest Palindromic Substring][005]| String, Dynamic Programming| |
| 73 | +| 6|[ZigZag Conversion][006]| String| |
| 74 | +| 8|[String to Integer (atoi)][008]| Math, String| |
| 75 | +| 11|[Container With Most Water][011]| Array, Two Pointers| |
| 76 | +| 12|[Integer to Roman][012]| Math, String| |
| 77 | +| 15|[3Sum][015]| Array, Two Pointers| |
| 78 | +| 15|[3Sum Closest][016]| Array, Two Pointers| |
| 79 | +| 17|[Letter Combinations of a Phone Number][017]| String, Backtracking| |
| 80 | +| 18|[4Sum][018]| Array, Hash Table, Two Pointers| |
| 81 | +| 19|[Remove Nth Node From End of List][019]| Linked List, Two Pointers| |
| 82 | +| 22|[Generate Parentheses][022]| String, Backtracking| |
| 83 | +| 24|[Swap Nodes in Pairs][024]| Linked List| |
| 84 | +| 29|[Divide Two Integers][029]| Math, Binary Search| |
| 85 | +| 33|[Search in Rotated Sorted Array][033]| Arrays, Binary Search| |
| 86 | +| 43|[Multiply Strings][043]| Math, String| |
| 87 | +| 49|[Group Anagrams][049]| Hash Table, String| |
| 88 | +| 50|[Pow(x, n)][050]| Math, Binary Search| |
| 89 | +| 56|[Merge Intervals][056]| Array, Sort| |
| 90 | +| 554|[Brick Wall][554]| Hash Table| |
82 | 91 |
|
83 | 92 |
|
84 | 93 | ##Hard
|
85 | 94 |
|
86 |
| -|#|Title|Tag| |
87 |
| -|:-------------|:-------------|:-------------| |
88 |
| -|4|[Median of Two Sorted Arrays][004]|Array, Binary Search, Divide and Conquer| |
89 |
| -|10|[Regular Expression Matching][010]|String, Dynamic Programming, Backtracking| |
90 |
| -|23|[Merge k Sorted Lists][023]|Linked List, Divide and Conquer, Heap| |
91 |
| -|25|[Reverse Nodes in k-Group][025]|Linked List| |
92 |
| -|44|[Reverse Nodes in k-Group][044]|String, Dynamic Programming, Backtracking, Greedy| |
93 |
| -|57|[Insert Interval][057]|Array, Sort| |
| 95 | +| #| Title| Tag| |
| 96 | +| :---| :---------------------------------------| :---------------------------------------| |
| 97 | +| 4|[Median of Two Sorted Arrays][004]| Array, Binary Search, Divide and Conquer| |
| 98 | +| 10|[Regular Expression Matching][010]| String, Dynamic Programming, Backtracking| |
| 99 | +| 23|[Merge k Sorted Lists][023]| Linked List, Divide and Conquer, Heap| |
| 100 | +| 25|[Reverse Nodes in k-Group][025]| Linked List| |
| 101 | +| 30|[Substring with Concatenation of All Words][030]| Hash Table, Two Pointers, String| |
| 102 | +| 44|[Wildcard Matching][044]| String, Dynamic Programming, Backtracking, Greedy| |
| 103 | +| 57|[Insert Interval][057]| Array, Sort| |
| 104 | +| 68|[Text Justification][068]| String| |
94 | 105 |
|
95 | 106 |
|
96 | 107 |
|
|
135 | 146 |
|
136 | 147 | [002]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/002/README.md
|
137 | 148 | [003]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/003/README.md
|
| 149 | +[005]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/005/README.md |
| 150 | +[006]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/006/README.md |
138 | 151 | [008]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/008/README.md
|
| 152 | +[011]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/011/README.md |
| 153 | +[012]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/012/README.md |
139 | 154 | [015]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/015/README.md
|
| 155 | +[016]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/016/README.md |
140 | 156 | [017]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/017/README.md
|
| 157 | +[018]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/018/README.md |
141 | 158 | [019]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/019/README.md
|
| 159 | +[022]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/022/README.md |
| 160 | +[024]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/024/README.md |
| 161 | +[029]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/029/README.md |
142 | 162 | [033]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/033/README.md
|
143 | 163 | [043]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/043/README.md
|
144 | 164 | [049]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/049/README.md
|
|
150 | 170 | [010]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/010/README.md
|
151 | 171 | [023]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/023/README.md
|
152 | 172 | [025]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/025/README.md
|
| 173 | +[030]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/030/README.md |
153 | 174 | [044]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/044/README.md
|
154 | 175 | [057]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/057/README.md
|
| 176 | +[068]:https://github.com/Blankj/awesome-java-leetcode/blob/master/note/068/README.md |