Skip to content

Commit 3e53b17

Browse files
author
Openset
committed
Add: Related Topics
1 parent 319c8ab commit 3e53b17

File tree

736 files changed

+3199
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

736 files changed

+3199
-117
lines changed

Diff for: problems/01-matrix/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ Output:
4949
<li>The cells are adjacent in only four directions: up, down, left and right.</li>
5050
</ol>
5151
</p>
52+
53+
54+
### Related Topics
55+
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[Breadth-first Search](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)]

Diff for: problems/1-bit-and-2-bit-characters/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ The only way to decode it is two-bit character and two-bit character. So the las
3636
<li><code>bits[i]</code> is always <code>0</code> or <code>1</code>.</li>
3737
</p>
3838

39+
### Related Topics
40+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
41+
3942
### Similar Questions
4043
1. [Gray Code](https://github.com/openset/leetcode/tree/master/problems/gray-code) (Medium)
44+
45+
### Hints
46+
1. Keep track of where the next character starts. At the end, you want to know if you started on the last bit.

Diff for: problems/132-pattern/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ that <b>i</b> < <b>j</b> < <b>k</b> and a<sub><b>i</b></sub> < a<sub><b>k</b></s
4141

4242
<b>Explanation:</b> There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
4343
</pre>
44-
</p>
44+
</p>
45+
46+
### Related Topics
47+
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]

Diff for: problems/2-keys-keyboard/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,11 @@ In step 3, we use <b>Paste</b> operation to get 'AAA'.
3838
</ol>
3939
</p>
4040

41+
### Related Topics
42+
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
43+
4144
### Similar Questions
4245
1. [4 Keys Keyboard](https://github.com/openset/leetcode/tree/master/problems/4-keys-keyboard) (Medium)
46+
47+
### Hints
48+
1. How many characters may be there in the clipboard at the last step if n = 3? n = 7? n = 10? n = 24?

Diff for: problems/24-game/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ You have 4 cards each containing a number from 1 to 9. You need to judge whethe
3333
<li>You cannot concatenate numbers together. For example, if the input is <code>[1, 2, 1, 2]</code>, we cannot write this as 12 + 12.</li>
3434
</ol>
3535
</p>
36-
</p>
36+
</p>
37+
38+
### Related Topics
39+
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

Diff for: problems/3sum-closest/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
1818
</pre>
1919

2020

21+
### Related Topics
22+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)]
23+
2124
### Similar Questions
2225
1. [3Sum](https://github.com/openset/leetcode/tree/master/problems/3sum) (Medium)
2326
1. [3Sum Smaller](https://github.com/openset/leetcode/tree/master/problems/3sum-smaller) (Medium)

Diff for: problems/3sum-with-multiplicity/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ and two 2s from [2,2,2,2] in 6 ways.
4747
<li><code>3 &lt;= A.length &lt;= 3000</code></li>
4848
<li><code>0 &lt;= A[i] &lt;= 100</code></li>
4949
<li><code>0 &lt;= target &lt;= 300</code></li>
50-
</ol>
50+
</ol>
51+
52+
### Related Topics
53+
[[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)]

Diff for: problems/3sum/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ A solution set is:
2626
</pre>
2727

2828

29+
### Related Topics
30+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)]
31+
2932
### Similar Questions
3033
1. [Two Sum](https://github.com/openset/leetcode/tree/master/problems/two-sum) (Easy)
3134
1. [3Sum Closest](https://github.com/openset/leetcode/tree/master/problems/3sum-closest) (Medium)

Diff for: problems/4sum-ii/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ The two tuples are:
2929
</pre>
3030
</p>
3131

32+
### Related Topics
33+
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)]
34+
3235
### Similar Questions
3336
1. [4Sum](https://github.com/openset/leetcode/tree/master/problems/4sum) (Medium)

Diff for: problems/4sum/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ A solution set is:
2727
</pre>
2828

2929

30+
### Related Topics
31+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)] [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)]
32+
3033
### Similar Questions
3134
1. [Two Sum](https://github.com/openset/leetcode/tree/master/problems/two-sum) (Easy)
3235
1. [3Sum](https://github.com/openset/leetcode/tree/master/problems/3sum) (Medium)

Diff for: problems/accounts-merge/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ We could return these lists in any order, for example the answer [['Mary', 'mary
3232
<li>The length of <code>accounts[i][j]</code> will be in the range <code>[1, 30]</code>.</li>
3333
</p>
3434

35+
### Related Topics
36+
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[Union Find](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)]
37+
3538
### Similar Questions
3639
1. [Redundant Connection](https://github.com/openset/leetcode/tree/master/problems/redundant-connection) (Medium)
3740
1. [Sentence Similarity](https://github.com/openset/leetcode/tree/master/problems/sentence-similarity) (Easy)
3841
1. [Sentence Similarity II](https://github.com/openset/leetcode/tree/master/problems/sentence-similarity-ii) (Medium)
42+
43+
### Hints
44+
1. For every pair of emails in the same account, draw an edge between those emails. The problem is about enumerating the connected components of this graph.

Diff for: problems/add-and-search-word-data-structure-design/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ search(&quot;b..&quot;) -&gt; true
3232
You may assume that all words are consist of lowercase letters <code>a-z</code>.</p>
3333

3434

35+
### Related Topics
36+
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)] [[Trie](https://github.com/openset/leetcode/tree/master/tag/trie/README.md)] [[Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)]
37+
3538
### Similar Questions
3639
1. [Implement Trie (Prefix Tree)](https://github.com/openset/leetcode/tree/master/problems/implement-trie-prefix-tree) (Medium)
3740
1. [Prefix and Suffix Search](https://github.com/openset/leetcode/tree/master/problems/prefix-and-suffix-search) (Hard)
41+
42+
### Hints
43+
1. You should be familiar with how a Trie works. If not, please work on this problem: <a href="https://leetcode.com/problems/implement-trie-prefix-tree/">Implement Trie (Prefix Tree)</a> first.

Diff for: problems/add-binary/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<strong>Output:</strong> &quot;10101&quot;</pre>
2525

2626

27+
### Related Topics
28+
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]
29+
2730
### Similar Questions
2831
1. [Add Two Numbers](https://github.com/openset/leetcode/tree/master/problems/add-two-numbers) (Medium)
2932
1. [Multiply Strings](https://github.com/openset/leetcode/tree/master/problems/multiply-strings) (Medium)

Diff for: problems/add-digits/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,14 @@
2121
<p><b>Follow up:</b><br />
2222
Could you do it without any loop/recursion in O(1) runtime?</p>
2323

24+
### Related Topics
25+
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]
26+
2427
### Similar Questions
2528
1. [Happy Number](https://github.com/openset/leetcode/tree/master/problems/happy-number) (Easy)
29+
30+
### Hints
31+
1. A naive implementation of the above process is trivial. Could you come up with other methods?
32+
1. What are all the possible results?
33+
1. How do they occur, periodically or randomly?
34+
1. You may find this <a href="https://en.wikipedia.org/wiki/Digital_root" target="_blank">Wikipedia article</a> useful.

Diff for: problems/add-one-row-to-tree/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,7 @@ A binary tree as following:
6868
<li>The given d is in range [1, maximum depth of the given tree + 1].</li>
6969
<li>The given binary tree has at least one tree node.</li>
7070
</ol>
71-
</p>
71+
</p>
72+
73+
### Related Topics
74+
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)]

Diff for: problems/add-strings/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
</ol>
1919
</p>
2020

21+
### Related Topics
22+
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]
23+
2124
### Similar Questions
2225
1. [Add Two Numbers](https://github.com/openset/leetcode/tree/master/problems/add-two-numbers) (Medium)
2326
1. [Multiply Strings](https://github.com/openset/leetcode/tree/master/problems/multiply-strings) (Medium)

Diff for: problems/add-two-numbers-ii/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ What if you cannot modify the input lists? In other words, reversing the lists i
2323
</pre>
2424
</p>
2525

26+
### Related Topics
27+
[[Linked List](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)]
28+
2629
### Similar Questions
2730
1. [Add Two Numbers](https://github.com/openset/leetcode/tree/master/problems/add-two-numbers) (Medium)

Diff for: problems/add-two-numbers/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
</pre>
2121

2222

23+
### Related Topics
24+
[[Linked List](https://github.com/openset/leetcode/tree/master/tag/linked-list/README.md)] [[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)]
25+
2326
### Similar Questions
2427
1. [Multiply Strings](https://github.com/openset/leetcode/tree/master/problems/multiply-strings) (Medium)
2528
1. [Add Binary](https://github.com/openset/leetcode/tree/master/problems/add-binary) (Easy)

Diff for: problems/additive-number/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@
3535
<p><b>Follow up:</b><br />
3636
How would you handle overflow for very large input integers?</p>
3737

38+
### Related Topics
39+
[[Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)]
40+
3841
### Similar Questions
3942
1. [Split Array into Fibonacci Sequence](https://github.com/openset/leetcode/tree/master/problems/split-array-into-fibonacci-sequence) (Medium)

Diff for: problems/advantage-shuffle/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@
4040
</ol>
4141
</div>
4242
</div>
43+
44+
45+
### Related Topics
46+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)] [[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]

Diff for: problems/all-nodes-distance-k-in-binary-tree/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ The descriptions of the inputs above are just serializations of these objects.
4545
<li><code>0 &lt;= K &lt;= 1000</code>.</li>
4646
</ol>
4747
</div>
48+
49+
50+
### Related Topics
51+
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)] [[Breadth-first Search](https://github.com/openset/leetcode/tree/master/tag/breadth-first-search/README.md)]

Diff for: problems/all-oone-data-structure/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@
2020

2121
<p>
2222
Challenge: Perform all these in O(1) time complexity.
23-
</p>
23+
</p>
24+
25+
### Related Topics
26+
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)]

Diff for: problems/all-possible-full-binary-trees/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@
3333
<ul>
3434
<li><code>1 &lt;= N &lt;= 20</code></li>
3535
</ul>
36+
37+
38+
### Related Topics
39+
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[Recursion](https://github.com/openset/leetcode/tree/master/tag/recursion/README.md)]

Diff for: problems/ambiguous-coordinates/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@
5151
</ul>
5252

5353
<p>&nbsp;</p>
54+
55+
56+
### Related Topics
57+
[[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]

Diff for: problems/arithmetic-slices-ii-subsequence/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@ All arithmetic subsequence slices are:
4444
</pre>
4545
</p>
4646

47+
### Related Topics
48+
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
49+
4750
### Similar Questions
4851
1. [Arithmetic Slices](https://github.com/openset/leetcode/tree/master/problems/arithmetic-slices) (Medium)

Diff for: problems/arithmetic-slices/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ A = [1, 2, 3, 4]
3232
return: 3, for 3 arithmetic slices in A: [1, 2, 3], [2, 3, 4] and [1, 2, 3, 4] itself.
3333
</pre>
3434

35+
### Related Topics
36+
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
37+
3538
### Similar Questions
3639
1. [Arithmetic Slices II - Subsequence](https://github.com/openset/leetcode/tree/master/problems/arithmetic-slices-ii-subsequence) (Hard)

Diff for: problems/arranging-coins/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ The coins can form the following rows:
3838

3939
Because the 4th row is incomplete, we return 3.
4040
</pre>
41-
</p>
41+
</p>
42+
43+
### Related Topics
44+
[[Math](https://github.com/openset/leetcode/tree/master/tag/math/README.md)] [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)]

Diff for: problems/array-nesting/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ S[0] = {A[0], A[5], A[6], A[2]} = {5, 6, 2, 0}
3131
</ol>
3232
</p>
3333

34+
### Related Topics
35+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
36+
3437
### Similar Questions
3538
1. [Nested List Weight Sum](https://github.com/openset/leetcode/tree/master/problems/nested-list-weight-sum) (Easy)
3639
1. [Flatten Nested List Iterator](https://github.com/openset/leetcode/tree/master/problems/flatten-nested-list-iterator) (Medium)

Diff for: problems/array-of-doubled-pairs/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,7 @@
6666
</div>
6767
</div>
6868
</div>
69+
70+
71+
### Related Topics
72+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)] [[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]

Diff for: problems/array-partition-i/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ Given an array of <b>2n</b> integers, your task is to group these integers into
2525
<li><b>n</b> is a positive integer, which is in the range of [1, 10000].</li>
2626
<li>All the integers in the array will be in the range of [-10000, 10000].</li>
2727
</ol>
28-
</p>
28+
</p>
29+
30+
### Related Topics
31+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
32+
### Hints
33+
1. Obviously, brute force won't help here. Think of something else, take some example like 1,2,3,4.
34+
1. How will you make pairs to get the result? There must be some pattern.
35+
1. Did you observe that- Minimum element gets add into the result in sacrifice of maximum element.
36+
1. Still won't able to find pairs? Sort the array and try to find the pattern.

Diff for: problems/assign-cookies/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ You need to output 1.
3838
You have 3 cookies and their sizes are big enough to gratify all of the children,
3939
You need to output 2.
4040
</pre>
41-
</p>
41+
</p>
42+
43+
### Related Topics
44+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]

Diff for: problems/asteroid-collision/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,11 @@ Asteroids moving the same direction never meet, so no asteroids will meet each o
6161
<li>Each asteroid will be a non-zero integer in the range <code>[-1000, 1000].</code>.</li>
6262
</p>
6363

64+
### Related Topics
65+
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]
66+
6467
### Similar Questions
6568
1. [Can Place Flowers](https://github.com/openset/leetcode/tree/master/problems/can-place-flowers) (Easy)
69+
70+
### Hints
71+
1. Say a row of asteroids is stable. What happens when a new asteroid is added on the right?

Diff for: problems/average-of-levels-in-binary-tree/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2
2929
</ol>
3030
</p>
3131

32+
### Related Topics
33+
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)]
34+
3235
### Similar Questions
3336
1. [Binary Tree Level Order Traversal](https://github.com/openset/leetcode/tree/master/problems/binary-tree-level-order-traversal) (Medium)
3437
1. [Binary Tree Level Order Traversal II](https://github.com/openset/leetcode/tree/master/problems/binary-tree-level-order-traversal-ii) (Easy)

Diff for: problems/backspace-string-compare/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@
6262
</div>
6363
</div>
6464
</div>
65+
66+
67+
### Related Topics
68+
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)] [[Two Pointers](https://github.com/openset/leetcode/tree/master/tag/two-pointers/README.md)]

Diff for: problems/bag-of-tokens/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@
5959
</div>
6060
</div>
6161
</div>
62+
63+
64+
### Related Topics
65+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]

Diff for: problems/balanced-binary-tree/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@
4545
<p>Return false.</p>
4646

4747

48+
### Related Topics
49+
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] [[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]
50+
4851
### Similar Questions
4952
1. [Maximum Depth of Binary Tree](https://github.com/openset/leetcode/tree/master/problems/maximum-depth-of-binary-tree) (Easy)

Diff for: problems/baseball-game/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,7 @@ Round 7: You could get 9 + 5 = 14 points. The sum is 27.
6161
<p><b>Note:</b><br />
6262
<li>The size of the input list will be between 1 and 1000.</li>
6363
<li>Every integer represented in the list will be between -30000 and 30000.</li>
64-
</p>
64+
</p>
65+
66+
### Related Topics
67+
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]

Diff for: problems/basic-calculator-ii/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
<li><b>Do not</b> use the <code>eval</code> built-in library function.</li>
3939
</ul>
4040

41+
### Related Topics
42+
[[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]
43+
4144
### Similar Questions
4245
1. [Basic Calculator](https://github.com/openset/leetcode/tree/master/problems/basic-calculator) (Hard)
4346
1. [Expression Add Operators](https://github.com/openset/leetcode/tree/master/problems/expression-add-operators) (Hard)

0 commit comments

Comments
 (0)