Leetcode
的 Golang
解法 😋
🔥 Algorithms | ✨ Other
Algorithms
# | Title | Topics | Difficulty |
---|---|---|---|
1 | Two Sum | Array, Hash Table | Easy |
2 | Add Two Numbers | Linked List, Math | Medium |
3 | Longest Substring Without Repeating Characters | Hash Table, Two Pointers, String | Medium |
4 | Median of Two Sorted Arrays | Array, Binary Search, Divide and Conquer | Hard |
5 | Longest Palindromic Substring | String, Dynamic Programming | Medium |
6 | ZigZag Conversion | String | Medium |
7 | Reverse Integer | Math | Easy |
8 | String to Integer (atoi) | Math, String | Medium |
9 | Palindrome Number | Math | Easy |
10 | Regular Expression Matching | String, Dynamic Programming, Backtracking | Hard |
11 | Container With Most Water | Array, Two Pointers | Medium |
12 | Integer to Roman | Math, String | Medium |
13 | Roman to Integer | Math, String | Easy |
14 | Longest Common Prefix | String | Easy |
15 | 3Sum | Array, Two Pointers | Medium |
16 | 3Sum Closest | Array, Two Pointers | Medium |
17 | Letter Combinations of a Phone Number | String, Backtracking | Medium |
18 | 4Sum | Array, Hash Table, Two Pointers | Medium |
19 | Remove Nth Node From End of List | Linked List, Two Pointers | Medium |
20 | Valid Parentheses | String, Stack | Easy |
21 | Merge Two Sorted Lists | Linked List | Easy |
22 | Generate Parentheses | String, Backtracking | Medium |
23 | Merge k Sorted Lists | Linked List, Divide and Conquer, Heap | Hard |
24 | Swap Nodes in Pairs | Linked List | Medium |
25 | Reverse Nodes in k-Group | Linked List | Hard |
26 | Remove Duplicates from Sorted Array | Array, Two Pointers | Easy |
27 | Remove Element | Array, Two Pointers | Easy |
28 | Implement strStr() | Two Pointers, String | Easy |
29 | Divide Two Integers | Math, Binary Search | Medium |
30 | Substring with Concatenation of All Words | Hash Table, Two Pointers, String | Hard |
31 | Next Permutation | Array | Medium |
32 | Longest Valid Parentheses | String, Dynamic Programming | Hard |
33 | Search in Rotated Sorted Array | Array, Binary Search | Medium |
34 | Search for a Range | Array, Binary Search | Medium |
35 | Search Insert Position | Array, Binary Search | Easy |
38 | Count and Say | String | Easy |
39 | Combination Sum | Array, Backtracking | Medium |
40 | Combination Sum II | Array, Backtracking | Medium |
44 | Wildcard Matching | String, Dynamic Programming, Backtracking, Greedy | Hard |
46 | Permutations | Backtracking | Medium |
48 | Rotate Image | Array | Medium |
49 | Group Anagrams | Hash Table, String | Medium |
53 | Maximum Subarray | Array, Divide and Conquer, Dynamic Programming | Easy |
56 | Merge Intervals | Array, Sort | Medium |
57 | Insert Interval | Array, Sort | Hard |
58 | Length of Last Word | String | Easy |
61 | Rotate List | Linked List, Two Pointers | Medium |
62 | Unique Paths | Array, Dynamic Programming | Medium |
63 | Unique Paths II | Array, Dynamic Programming | Medium |
64 | Minimum Path Sum | Array, Dynamic Programming | Medium |
67 | Add Binary | Math, String | Easy |
69 | Sqrt(x) | Math, Binary Search | Easy |
70 | Climbing Stairs | Dynamic Programming | Easy |
71 | Simplify Path | String, Stack | Medium |
72 | Edit Distance | String, Dynamic Programming | Hard |
78 | Subsets | Array, Backtracking, Bit Manipulation | Medium |
81 | Search in Rotated Sorted Array II | Array, Binary Search | Medium |
83 | Remove Duplicates from Sorted List | Linked List | Easy |
84 | Largest Rectangle in Histogram | Array, Stack | Hard |
85 | Maximal Rectangle | Array, Hash Table, Dynamic Programming, Stack | Hard |
88 | Merge Sorted Array | Array, Two Pointers | Easy |
91 | Decode Ways | String, Dynamic Programming | Medium |
94 | Binary Tree Inorder Traversal | Hash Table, Stack, Tree | Medium |
96 | Unique Binary Search Trees | Dynamic Programming, Tree | Medium |
100 | Same Tree | Tree, Depth-first Search | Easy |
101 | Symmetric Tree | Tree, Depth-first Search, Breadth-first Search | Easy |
102 | Binary Tree Level Order Traversal | Tree, Breadth-first Search | Medium |
103 | Binary Tree Zigzag Level Order Traversal | Stack, Tree, Breadth-first Search | Medium |
104 | Maximum Depth of Binary Tree | Tree, Depth-first Search | Easy |
107 | Binary Tree Level Order Traversal II | Tree, Breadth-first Search | Easy |
108 | Convert Sorted Array to Binary Search Tree | Tree, Depth-first Search | Easy |
110 | Balanced Binary Tree | Tree, Depth-first Search | Easy |
111 | Minimum Depth of Binary Tree | Tree, Depth-first Search, Breadth-first Search | Easy |
112 | Path Sum | Tree, Depth-first Search | Easy |
118 | Pascal’s Triangle | Array | Easy |
119 | Pascal’s Triangle II | Array | Easy |
121 | Best Time to Buy and Sell Stock | Array, Dynamic Programming | Easy |
122 | Best Time to Buy and Sell Stock II | Array, Greedy | Easy |
125 | Valid Palindrome | Two Pointers, String | Easy |
130 | Surrounded Regions | Depth-first Search, Breadth-first Search, Union Find | Medium |
136 | Single Number | Hash Table, Bit Manipulation | Easy |
141 | Linked List Cycle | Linked List, Two Pointers | Easy |
142 | Linked List Cycle II | Linked List, Two Pointers | Medium |
144 | Binary Tree Preorder Traversal | Stack, Tree | Medium |
145 | Binary Tree Postorder Traversal | Stack, Tree | Hard |
146 | LRU Cache | Design | Hard |
155 | Min Stack | Stack, Design | Easy |
165 | Compare Version Numbers | String | Medium |
168 | Excel Sheet Column Title | Math | Easy |
189 | Rotate Array | Array | Easy |
199 | Binary Tree Right Side View | Tree, Depth-first Search, Breadth-first Search | Medium |
200 | Number of Islands | Depth-first Search, Breadth-first Search, Union Find | Medium |
203 | Remove Linked List Elements | Linked List | Easy |
204 | Count Primes | Hash Table, Math | Easy |
205 | Isomorphic Strings | Hash Table | Easy |
206 | Reverse Linked List | Linked List | Easy |
207 | Course Schedule | Depth-first Search, Breadth-first Search, Graph, Topological Sort | Medium |
217 | Contains Duplicate | Array, Hash Table | Easy |
219 | Contains Duplicate II | Array, Hash Table | Easy |
257 | Binary Tree Paths | Tree, Depth-first Search | Easy |
344 | Reverse String | Two Pointers, String | Easy |
347 | Top K Frequent Elements | Hash Table, Heap | Medium |
435 | Non-overlapping Intervals | Greedy | Medium |
436 | Find Right Interval | Binary Search | Medium |
547 | Friend Circles | Depth-first Search, Union Find | Medium |
695 | Max Area of Island | Array, Depth-first Search | Easy |
739 | Daily Temperatures | Hash Table, Stack | Medium |
Other
# | Title | Tag |
---|---|---|
Ksum | Array, Two Pointers | |
0/1 knapsack | Dynamic Programming | |
Number of non-overlapping intervals | Greedy, Array, Sort |
Cmd
从Release中下载对应系统的命令行工具
Pull 抓取题目
用于自动生成需要写的题目并重新生成README.md
# 拉题目
$ leetcode-cli pull 1
Update 更新
Readme
// 根据模版文件更新readme
$ leetcode-cli update readme