Skip to content

Commit 9e52291

Browse files
author
openset
committed
Add: Related Topics
1 parent aa407fe commit 9e52291

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

problems/distant-barcodes/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ Next >
4444
<div>
4545
<div>&nbsp;</div>
4646
</div>
47+
48+
### Related Topics
49+
[[Heap](https://github.com/openset/leetcode/tree/master/tag/heap/README.md)]
50+
[[Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)]
51+
52+
### Hints
53+
<details>
54+
<summary>Hint 1</summary>
55+
We want to always choose the most common or second most common element to write next. What data structure allows us to query this effectively?
56+
</details>

problems/grumpy-bookstore-owner/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ The maximum number of customers that can be satisfied = 1 + 1 + 1 + 1 + 7 + 5 =
3939
<li><code>0 &lt;=&nbsp;customers[i] &lt;= 1000</code></li>
4040
<li><code>0 &lt;=&nbsp;grumpy[i] &lt;= 1</code></li>
4141
</ul>
42+
43+
### Related Topics
44+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
45+
[[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)]
46+
47+
### Hints
48+
<details>
49+
<summary>Hint 1</summary>
50+
Say the store owner uses their power in minute 1 to X and we have some answer A. If they instead use their power from minute 2 to X+1, we only have to use data from minutes 1, 2, X and X+1 to update our answer A.
51+
</details>

problems/height-checker/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ Students with heights 4, 3 and the last 1 are not standing in the right position
3434
<li><code>1 &lt;= heights.length &lt;= 100</code></li>
3535
<li><code>1 &lt;= heights[i] &lt;= 100</code></li>
3636
</ol>
37+
38+
### Related Topics
39+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
40+
41+
### Hints
42+
<details>
43+
<summary>Hint 1</summary>
44+
Build the correct order of heights by sorting another array, then compare the two arrays.
45+
</details>

problems/previous-permutation-with-one-swap/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,31 @@
2020
<pre>
2121
<strong>Input: </strong>[3,2,1]
2222
<strong>Output: </strong>[3,1,2]
23-
<strong>Explanation: </strong>
24-
Swapping 2 and 1.
23+
<strong>Explanation: </strong>Swapping 2 and 1.
2524
</pre>
2625

2726
<p><strong>Example 2:</strong></p>
2827

2928
<pre>
3029
<strong>Input: </strong>[1,1,5]
3130
<strong>Output: </strong>[1,1,5]
32-
<strong>Explanation: </strong>
33-
This is already the smallest permutation.
31+
<strong>Explanation: </strong>This is already the smallest permutation.
3432
</pre>
3533

3634
<p><strong>Example 3:</strong></p>
3735

3836
<pre>
3937
<strong>Input: </strong>[1,9,4,6,7]
4038
<strong>Output: </strong>[1,7,4,6,9]
41-
<strong>Explanation: </strong>
42-
Swapping 9 and 7.
39+
<strong>Explanation: </strong>Swapping 9 and 7.
4340
</pre>
4441

4542
<p><strong>Example 4:</strong></p>
4643

4744
<pre>
4845
<strong>Input: </strong>[3,1,1,3]
49-
<strong>Output: </strong>[1,1,3,3]
46+
<strong>Output: </strong>[1,3,1,3]
47+
<strong>Explanation: </strong>Swapping 1 and 3.
5048
</pre>
5149

5250
<p>&nbsp;</p>
@@ -57,3 +55,13 @@ Swapping 9 and 7.
5755
<li><code>1 &lt;= A.length &lt;= 10000</code></li>
5856
<li><code>1 &lt;= A[i] &lt;= 10000</code></li>
5957
</ol>
58+
59+
### Related Topics
60+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]
61+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
62+
63+
### Hints
64+
<details>
65+
<summary>Hint 1</summary>
66+
You need to swap two values, one larger than the other. Where is the larger one located?
67+
</details>

0 commit comments

Comments
 (0)