You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-23
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,13 @@ Dear LeetCoders! For a better LeetCode problem-solving experience, please visit
4
4
5
5
Hi there! I'm Lane.
6
6
Do you feel that there are too many problems (over 3,450) on the LeetCode and you can't finish them all?
7
-
Or do you forget how to solve the problems you did last time?
7
+
Or do you forget how to solve the problems you did last time?
8
+
8
9
If you can master some solution patterns, this will happen less often.
9
10
10
11
Here, I will provide you with **common problem-solving patterns** so that you don't waste time on problems that are not often tested in interviews.
11
12
12
-
Solutions for languages such as **Python, C++, Java, JavaScript, C#, Go, Ruby**, etc. will also be provided. If you have better solutions, welcome to create an issue or PR!
13
+
**Python, C++, Java, JavaScript, C#, Go, Ruby** languages' solutions are provided for every selected LeetCode problem. Other languages' solutions will be provided in the future. If you have better solutions, welcome to create an issue or PR!
13
14
14
15
## How to use this repo?
15
16
@@ -21,51 +22,55 @@ You can skip the more difficult problems and do them later.
21
22
-[27. Remove Element](en/1-1000/27-remove-element.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** ways.
22
23
-[704. Binary Search](en/1-1000/704-binary-search.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
23
24
-[977. Squares of a Sorted Array](en/1-1000/977-squares-of-a-sorted-array.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
24
-
-[209. Minimum Size Subarray Sum](en/1-1000/209-minimum-size-subarray-sum.md) was solved in _Python, Java, JavaScript, C#_.
25
+
-[209. Minimum Size Subarray Sum](en/1-1000/209-minimum-size-subarray-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby#_.
25
26
-[303. Range Sum Query - Immutable](en/1-1000/303-range-sum-query-immutable.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
26
-
-[59. Spiral Matrix II](en/1-1000/59-spiral-matrix-ii.md) was solved in _Python, Java, JavaScript, C#_.
27
+
-[59. Spiral Matrix II](en/1-1000/59-spiral-matrix-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
27
28
-[503. Next Greater Element II](en/1-1000/503-next-greater-element-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
29
+
-[3478. Choose K Elements With Maximum Sum](https://leetcoder.net/en/leetcode/3478-choose-k-elements-with-maximum-sum) was solved in _Python_.
28
30
29
31
# Linked List
30
32
-[203. Remove Linked List Elements](en/1-1000/203-remove-linked-list-elements.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
31
33
-[206. Reverse Linked List](en/1-1000/206-reverse-linked-list.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
32
-
-[160. Intersection of Two Linked Lists](en/1-1000/160-intersection-of-two-linked-lists.md) was solved in _Python, Java, JavaScript, C#_.
34
+
-[160. Intersection of Two Linked Lists](en/1-1000/160-intersection-of-two-linked-lists.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
33
35
-[19. Remove Nth Node From End of List](en/1-1000/19-remove-nth-node-from-end-of-list.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
34
-
-[707. Design Linked List](en/1-1000/707-design-linked-list.md) was solved in _Python, Java, JavaScript, C#_.
36
+
-[707. Design Linked List](en/1-1000/707-design-linked-list.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby#_.
35
37
-[24. Swap Nodes in Pairs](en/1-1000/24-swap-nodes-in-pairs.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
36
38
37
39
# Hash Table
38
40
-[349. Intersection of Two Arrays](en/1-1000/349-intersection-of-two-arrays.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
39
-
-[242. Valid Anagram](en/1-1000/242-valid-anagram.md) was solved in _Python, Java, JavaScript, C#_.
41
+
-[242. Valid Anagram](en/1-1000/242-valid-anagram.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
40
42
-[1. Two Sum](en/1-1000/1-two-sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
41
-
-[383. Ransom Note](en/1-1000/383-ransom-note.md) was solved in _Python, Java, JavaScript, C#_.
42
-
-[202. Happy Number](en/1-1000/202-happy-number.md) was solved in _Python, Java, JavaScript, C#_.
43
-
-[454. 4Sum II](en/1-1000/454-4sum-ii.md) was solved in _Python, Java, JavaScript, C#, Ruby_.
43
+
-[383. Ransom Note](en/1-1000/383-ransom-note.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
44
+
-[202. Happy Number](en/1-1000/202-happy-number.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
45
+
-[454. 4Sum II](en/1-1000/454-4sum-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
46
+
-[49. Group Anagrams](https://leetcoder.net/en/leetcode/49-group-anagrams) was solved in _Python, Ruby_.
44
47
45
48
# String
46
-
-[28. Find the Index of the First Occurrence in a String](en/1-1000/28-find-the-index-of-the-first-occurrence-in-a-string.md) was solved in _Python, JavaScript_.
47
-
-[541. Reverse String II](en/1-1000/541-reverse-string-ii.md) was solved in _Python, Java, JavaScript, C#, Ruby_.
48
-
-[459. Repeated Substring Pattern](en/1-1000/459-repeated-substring-pattern.md) was solved in _Python, JavaScript_.
49
+
-[28. Find the Index of the First Occurrence in a String](en/1-1000/28-find-the-index-of-the-first-occurrence-in-a-string.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
50
+
-[541. Reverse String II](en/1-1000/541-reverse-string-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
51
+
-[459. Repeated Substring Pattern](en/1-1000/459-repeated-substring-pattern.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
52
+
-[833. Find And Replace in String](https://leetcoder.net/en/leetcode/833-find-and-replace-in-string) was solved in _Python_.
49
53
50
54
# Two Pointers
51
-
-[15. 3Sum](en/1-1000/15-3sum.md) was solved in _Python_ and 2 ways.
52
-
-[18. 4Sum](en/1-1000/18-4sum.md) was solved in _Python_.
55
+
-[15. 3Sum](en/1-1000/15-3sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and 2 ways.
56
+
-[18. 4Sum](en/1-1000/18-4sum.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
53
57
54
-
# Stack
55
-
-[20. Valid Parentheses](en/1-1000/20-valid-parentheses.md) was solved in _Python, JavaScript_.
56
-
-[232. Implement Queue using Stacks](en/1-1000/232-implement-queue-using-stacks.md) was solved in _Python, JavaScript_.
58
+
# Stack & Queue
59
+
-[20. Valid Parentheses](en/1-1000/20-valid-parentheses.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
60
+
-[232. Implement Queue using Stacks](en/1-1000/232-implement-queue-using-stacks.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
61
+
-[225. Implement Stack using Queues](en/1-1000/225-implement-stack-using-queues.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and 3 ways.
57
62
58
-
# Queue
59
-
-[225. Implement Stack using Queues](en/1-1000/225-implement-stack-using-queues.md) was solved in _Python, JavaScript_and 3 ways.
63
+
# Binary Tree
64
+
-[144. Binary Tree Preorder Traversal](en/1-1000/144-binary-tree-preorder-traversal.md) was solved in _Python_and 2 ways.
60
65
61
66
# Dynamic Programming
62
-
## Basics
67
+
## Easy Problems
63
68
-[509. Fibonacci Number](en/1-1000/509-fibonacci-number.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
64
69
65
70
## House Robber
66
71
-[198. House Robber](en/1-1000/198-house-robber.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
67
-
-[213. House Robber II](en/1-1000/213-house-robber-ii.md) was solved in _Python, JavaScript, Go_.
68
-
-[337. House Robber III](en/1-1000/337-house-robber-iii.md) was solved in _Python, JavaScript, Go_ and **2** ways.
72
+
-[213. House Robber II](en/1-1000/213-house-robber-ii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
73
+
-[337. House Robber III](en/1-1000/337-house-robber-iii.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** ways.
69
74
70
75
## Knapsack Problems
71
76
### 0/1 Knapsack
@@ -100,12 +105,17 @@ You can skip the more difficult problems and do them later.
100
105
-[583. Delete Operation for Two Strings](en/1-1000/583-delete-operation-for-two-strings.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
101
106
-[72. Edit Distance](en/1-1000/72-edit-distance.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
102
107
108
+
## Hard Problems
109
+
-[3494. Find the Minimum Amount of Time to Brew Potions](https://leetcoder.net/en/leetcode/3494-find-the-minimum-amount-of-time-to-brew-potions) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
110
+
103
111
# Monotonic Stack
104
112
-[739. Daily Temperatures](en/1-1000/739-daily-temperatures.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
105
113
-[496. Next Greater Element I](en/1-1000/496-next-greater-element-i.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
106
114
-[42. Trapping Rain Water](en/1-1000/42-trapping-rain-water.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby.
107
115
-[84. Largest Rectangle in Histogram](en/1-1000/84-largest-rectangle-in-histogram.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_.
108
116
117
+
118
+
109
119
# Graph Theory
110
120
-[797. All Paths From Source to Target](en/1-1000/797-all-paths-from-source-to-target.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **2** ways.
111
121
-[200. Number of Islands](en/1-1000/200-number-of-islands.md) was solved in _Python, Java, C++, JavaScript, C#, Go, Ruby_ and **3** ways.
0 commit comments