Skip to content

Commit 9203338

Browse files
author
openset
committed
Add: new
1 parent 91c11c0 commit 9203338

File tree

50 files changed

+551
-65
lines changed

Some content is hidden

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

50 files changed

+551
-65
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ LeetCode Problems' Solutions
5454

5555
| # | Title | Solution | Difficulty |
5656
| :-: | - | - | :-: |
57+
| <span id="1102">1102</span> | [Path With Maximum Minimum Value](https://leetcode.com/problems/path-with-maximum-minimum-value "得分最高的路径") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/path-with-maximum-minimum-value) | Medium |
58+
| <span id="1101">1101</span> | [The Earliest Moment When Everyone Become Friends](https://leetcode.com/problems/the-earliest-moment-when-everyone-become-friends "彼此熟识的最早时间") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/the-earliest-moment-when-everyone-become-friends) | Medium |
59+
| <span id="1100">1100</span> | [Find K-Length Substrings With No Repeated Characters](https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters "长度为 K 的无重复字符子串") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/find-k-length-substrings-with-no-repeated-characters) | Medium |
60+
| <span id="1099">1099</span> | [Two Sum Less Than K](https://leetcode.com/problems/two-sum-less-than-k "小于 K 的两数之和") 🔒 | [Go](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k) | Easy |
61+
| <span id="1098">1098</span> | [Unpopular Books](https://leetcode.com/problems/unpopular-books) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/unpopular-books) | Medium |
62+
| <span id="1097">1097</span> | [Game Play Analysis V](https://leetcode.com/problems/game-play-analysis-v) 🔒 | [MySQL](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-v) | Hard |
5763
| <span id="1096">1096</span> | [Brace Expansion II](https://leetcode.com/problems/brace-expansion-ii "花括号展开 II") | [Go](https://github.com/openset/leetcode/tree/master/problems/brace-expansion-ii) | Hard |
5864
| <span id="1095">1095</span> | [Find in Mountain Array](https://leetcode.com/problems/find-in-mountain-array "山脉数组中查找目标值") | [Go](https://github.com/openset/leetcode/tree/master/problems/find-in-mountain-array) | Hard |
5965
| <span id="1094">1094</span> | [Car Pooling](https://leetcode.com/problems/car-pooling "拼车") | [Go](https://github.com/openset/leetcode/tree/master/problems/car-pooling) | Medium |

problems/brace-expansion-ii/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[< Previous](https://github.com/openset/leetcode/tree/master/problems/find-in-mountain-array "Find in Mountain Array")
99

10-
Next >
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-v "Game Play Analysis V")
1111

1212
## 1096. Brace Expansion II (Hard)
1313

@@ -31,7 +31,7 @@ Next >
3131
<li>When we concatenate two expressions, we take the set of possible concatenations between two words where the first word comes from the first expression and the second word comes from the second expression.
3232
<ul>
3333
<li><code>R(&quot;{a,b}{c,d}&quot;) = {&quot;ac&quot;,&quot;ad&quot;,&quot;bc&quot;,&quot;bd&quot;}</code></li>
34-
<li><code>R(&quot;{a{b,c}}{{d,e},f{g,h}}&quot;) = R(&quot;{ab,ac}{dfg,dfh,efg,efh}&quot;) = {&quot;abdfg&quot;, &quot;abdfh&quot;, &quot;abefg&quot;, &quot;abefh&quot;, &quot;acdfg&quot;, &quot;acdfh&quot;, &quot;acefg&quot;, &quot;acefh&quot;}</code></li>
34+
<li><code>R(&quot;{a{b,c}}{{d,e}f{g,h}}&quot;) = R(&quot;{ab,ac}{dfg,dfh,efg,efh}&quot;) = {&quot;abdfg&quot;, &quot;abdfh&quot;, &quot;abefg&quot;, &quot;abefh&quot;, &quot;acdfg&quot;, &quot;acdfh&quot;, &quot;acefg&quot;, &quot;acefh&quot;}</code></li>
3535
</ul>
3636
</li>
3737
</ul>
@@ -76,3 +76,12 @@ Next >
7676
</ol>
7777
</div>
7878
</div>
79+
80+
### Related Topics
81+
[[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]
82+
83+
### Hints
84+
<details>
85+
<summary>Hint 1</summary>
86+
You can write helper methods to parse the next "chunk" of the expression. If you see eg. "a", the answer is just the set {a}. If you see "{", you parse until you complete the "}" (the number of { and } seen are equal) and that becomes a chunk that you find where the appropriate commas are, and parse each individual expression between the commas.
87+
</details>

problems/car-fleet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Note that no other cars meet these fleets before the destination, so the answer
5252
</ol>
5353

5454
### Related Topics
55-
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]
55+
[[Sort](https://github.com/openset/leetcode/tree/master/tag/sort/README.md)]

problems/car-pooling/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,12 @@
7171
<li><code>0 &lt;= trips[i][1] &lt; trips[i][2] &lt;= 1000</code></li>
7272
<li><code>1 &lt;=&nbsp;capacity &lt;= 100000</code></li>
7373
</ol>
74+
75+
### Related Topics
76+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]
77+
78+
### Hints
79+
<details>
80+
<summary>Hint 1</summary>
81+
Sort the pickup and dropoff events by location, then process them in order.
82+
</details>

problems/continuous-subarray-sum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## 523. Continuous Subarray Sum (Medium)
1313

14-
<p>Given a list of <b>non-negative</b> numbers and a target <b>integer</b> k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of <b>k</b>, that is, sums up to n*k where n is also an <b>integer</b>.</p>
14+
<p>Given a list of <b>non-negative</b> numbers and a target <b>integer</b> k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to a multiple of <b>k</b>, that is, sums up to n*k where n is also an <b>integer</b>.</p>
1515

1616
<p>&nbsp;</p>
1717

problems/cracking-the-safe/README.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,43 @@
1111

1212
## 753. Cracking the Safe (Hard)
1313

14-
<p>
15-
There is a box protected by a password. The password is <code>n</code> digits, where each letter can be one of the first <code>k</code> digits <code>0, 1, ..., k-1</code>.
16-
</p><p>
17-
You can keep inputting the password, the password will automatically be matched against the last <code>n</code> digits entered.
18-
</p><p>
19-
For example, assuming the password is <code>"345"</code>, I can open it when I type <code>"012345"</code>, but I enter a total of 6 digits.
20-
</p><p>
21-
Please return any string of minimum length that is guaranteed to open the box after the entire string is inputted.
22-
</p>
23-
24-
<p><b>Example 1:</b><br />
14+
<p>There is a box protected by a password. The password is a sequence of&nbsp;<code>n</code> digits&nbsp;where each digit can be one of the first <code>k</code> digits <code>0, 1, ..., k-1</code>.</p>
15+
16+
<p>While entering a password,&nbsp;the last <code>n</code> digits entered will automatically be matched against the correct password.</p>
17+
18+
<p>For example, assuming the correct password is <code>&quot;345&quot;</code>,&nbsp;if you type <code>&quot;012345&quot;</code>, the box will open because the correct password matches the suffix of the entered password.</p>
19+
20+
<p>Return any password of <strong>minimum length</strong> that is guaranteed to open the box at some point of entering it.</p>
21+
22+
<p>&nbsp;</p>
23+
24+
<p><b>Example 1:</b></p>
25+
2526
<pre>
2627
<b>Input:</b> n = 1, k = 2
27-
<b>Output:</b> "01"
28-
<b>Note:</b> "10" will be accepted too.
28+
<b>Output:</b> &quot;01&quot;
29+
<b>Note:</b> &quot;10&quot; will be accepted too.
2930
</pre>
30-
</p>
3131

32-
<p><b>Example 2:</b><br />
32+
<p><b>Example 2:</b></p>
33+
3334
<pre>
3435
<b>Input:</b> n = 2, k = 2
35-
<b>Output:</b> "00110"
36-
<b>Note:</b> "01100", "10011", "11001" will be accepted too.
36+
<b>Output:</b> &quot;00110&quot;
37+
<b>Note:</b> &quot;01100&quot;, &quot;10011&quot;, &quot;11001&quot; will be accepted too.
3738
</pre>
38-
</p>
3939

40-
<p><b>Note:</b><br>
40+
<p>&nbsp;</p>
41+
42+
<p><b>Note:</b></p>
43+
4144
<ol>
42-
<li><code>n</code> will be in the range <code>[1, 4]</code>.</li>
43-
<li><code>k</code> will be in the range <code>[1, 10]</code>.</li>
44-
<li><code>k^n</code> will be at most <code>4096</code>.</li>
45+
<li><code>n</code> will be in the range <code>[1, 4]</code>.</li>
46+
<li><code>k</code> will be in the range <code>[1, 10]</code>.</li>
47+
<li><code>k^n</code> will be at most <code>4096</code>.</li>
4548
</ol>
46-
</p>
49+
50+
<p>&nbsp;</p>
4751

4852
### Related Topics
4953
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

problems/design-compressed-string-iterator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ iterator.next(); // return ' '
5252
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)]
5353

5454
### Similar Questions
55-
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Hard)
55+
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Medium)
5656
1. [String Compression](https://github.com/openset/leetcode/tree/master/problems/string-compression) (Easy)

problems/design-in-memory-file-system/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)]
5151

5252
### Similar Questions
53-
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Hard)
53+
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Medium)
5454
1. [LFU Cache](https://github.com/openset/leetcode/tree/master/problems/lfu-cache) (Hard)
5555
1. [Design Log Storage System](https://github.com/openset/leetcode/tree/master/problems/design-log-storage-system) (Medium)

problems/duplicate-zeros/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@
4343
<li><code>1 &lt;= arr.length &lt;= 10000</code></li>
4444
<li><code>0 &lt;= arr[i] &lt;= 9</code></li>
4545
</ol>
46+
47+
### Related Topics
48+
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
49+
50+
### Hints
51+
<details>
52+
<summary>Hint 1</summary>
53+
Iterate through the array backwards. You know whether an integer should be written or not based on how many zeroes are remaining in the array.
54+
</details>

problems/find-in-mountain-array/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,13 @@
6363
<li><code>0 &lt;= target &lt;= 10^9</code></li>
6464
<li><code>0 &lt;= mountain_arr.get(index) &lt;=&nbsp;10^9</code></li>
6565
</ol>
66+
67+
### Related Topics
68+
[[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)]
69+
70+
### Hints
71+
<details>
72+
<summary>Hint 1</summary>
73+
Based on whether A[i-1] < A[i] < A[i+1], A[i-1] < A[i] > A[i+1], or A[i-1] > A[i] > A[i+1], we are either at the left side, peak, or right side of the mountain. We can binary search to find the peak.
74+
After finding the peak, we can binary search two more times to find whether the value occurs on either side of the peak.
75+
</details>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author Openset <[email protected]> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k "Two Sum Less Than K")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/the-earliest-moment-when-everyone-become-friends "The Earliest Moment When Everyone Become Friends")
11+
12+
## 5022. Find K-Length Substrings With No Repeated Characters (Medium)
13+
14+
<p>Given a string <code>S</code>, return the number of substrings of length <code>K</code> with no repeated characters.</p>
15+
16+
<p>&nbsp;</p>
17+
18+
<p><strong>Example 1:</strong></p>
19+
20+
<pre>
21+
<strong>Input: </strong>S = <span id="example-input-1-1">&quot;havefunonleetcode&quot;</span>, K = <span id="example-input-1-2">5</span>
22+
<strong>Output: </strong><span id="example-output-1">6</span>
23+
<strong>Explanation: </strong>
24+
There are 6 substrings they are : &#39;havef&#39;,&#39;avefu&#39;,&#39;vefun&#39;,&#39;efuno&#39;,&#39;etcod&#39;,&#39;tcode&#39;.
25+
</pre>
26+
27+
<p><strong>Example 2:</strong></p>
28+
29+
<pre>
30+
<strong>Input: </strong>S = <span id="example-input-2-1">&quot;home&quot;</span>, K = <span id="example-input-2-2">5</span>
31+
<strong>Output: </strong><span id="example-output-2">0</span>
32+
<strong>Explanation: </strong>
33+
Notice K can be larger than the length of S. In this case is not possible to find any substring.
34+
</pre>
35+
36+
<p>&nbsp;</p>
37+
38+
<p><strong>Note:</strong></p>
39+
40+
<ol>
41+
<li><code>1 &lt;= S.length &lt;= 10^4</code></li>
42+
<li>All characters of S are lowercase English letters.</li>
43+
<li><code>1 &lt;= K &lt;= 10^4</code></li>
44+
</ol>
45+
46+
### Related Topics
47+
[[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]
48+
[[Sliding Window](https://github.com/openset/leetcode/tree/master/tag/sliding-window/README.md)]
49+
50+
### Hints
51+
<details>
52+
<summary>Hint 1</summary>
53+
How to check efficiently each K-length substring?
54+
</details>
55+
56+
<details>
57+
<summary>Hint 2</summary>
58+
First store the first leftmost K-length substring in a hashTable or array of frequencies.
59+
</details>
60+
61+
<details>
62+
<summary>Hint 3</summary>
63+
Then iterate through the rest of characters and erase the first element and add the next element from the right. If in the hashTable we have K different character we add 1 to the counter. After that return as answer the counter.
64+
</details>

problems/friend-circles/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ Given a <b>N*N</b> matrix <b>M</b> representing the friend relationship between
5959
1. [Robot Return to Origin](https://github.com/openset/leetcode/tree/master/problems/robot-return-to-origin) (Easy)
6060
1. [Sentence Similarity](https://github.com/openset/leetcode/tree/master/problems/sentence-similarity) (Easy)
6161
1. [Sentence Similarity II](https://github.com/openset/leetcode/tree/master/problems/sentence-similarity-ii) (Medium)
62+
1. [The Earliest Moment When Everyone Become Friends](https://github.com/openset/leetcode/tree/master/problems/the-earliest-moment-when-everyone-become-friends) (Medium)

problems/game-play-analysis-i/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
## 511. Game Play Analysis I (Easy)
1313

1414

15+
16+
### Similar Questions
17+
1. [Game Play Analysis II](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-ii) (Easy)

problems/game-play-analysis-ii/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
## 512. Game Play Analysis II (Easy)
1313

1414

15+
16+
### Similar Questions
17+
1. [Game Play Analysis I](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-i) (Easy)
18+
1. [Game Play Analysis III](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iii) (Medium)

problems/game-play-analysis-iii/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
## 534. Game Play Analysis III (Medium)
1313

1414

15+
16+
### Similar Questions
17+
1. [Game Play Analysis II](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-ii) (Easy)
18+
1. [Game Play Analysis IV](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iv) (Medium)

problems/game-play-analysis-iv/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
## 550. Game Play Analysis IV (Medium)
1313

1414

15+
16+
### Similar Questions
17+
1. [Game Play Analysis III](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iii) (Medium)
18+
1. [Game Play Analysis V](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-v) (Hard)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author Openset <[email protected]> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
7+
8+
[< Previous](https://github.com/openset/leetcode/tree/master/problems/brace-expansion-ii "Brace Expansion II")
9+
                
10+
[Next >](https://github.com/openset/leetcode/tree/master/problems/unpopular-books "Unpopular Books")
11+
12+
## 1097. Game Play Analysis V (Hard)
13+
14+
15+
16+
### Similar Questions
17+
1. [Game Play Analysis IV](https://github.com/openset/leetcode/tree/master/problems/game-play-analysis-iv) (Medium)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Create table If Not Exists Activity (player_id int, device_id int, event_date date, games_played int);
2+
Truncate table Activity;
3+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-01', '5');
4+
insert into Activity (player_id, device_id, event_date, games_played) values ('1', '2', '2016-03-02', '6');
5+
insert into Activity (player_id, device_id, event_date, games_played) values ('2', '3', '2017-06-25', '1');
6+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '1', '2016-03-01', '0');
7+
insert into Activity (player_id, device_id, event_date, games_played) values ('3', '4', '2018-07-03', '5');

problems/increasing-order-search-tree/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## 897. Increasing Order Search Tree (Easy)
1313

14-
<p>Given a tree, rearrange the tree in <strong>in-order</strong> so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child.</p>
14+
<p>Given a binary search tree, rearrange the tree in <strong>in-order</strong> so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child.</p>
1515

1616
<pre>
1717
<strong>Example 1:</strong>

problems/largest-values-from-labels/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@
7373
</div>
7474
</div>
7575
</div>
76+
77+
### Related Topics
78+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]
79+
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]
80+
81+
### Hints
82+
<details>
83+
<summary>Hint 1</summary>
84+
Consider the items in order from largest to smallest value, and greedily take the items if they fall under the use_limit. We can keep track of how many items of each label are used by using a hash table.
85+
</details>

problems/letter-case-permutation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838

3939
### Similar Questions
4040
1. [Subsets](https://github.com/openset/leetcode/tree/master/problems/subsets) (Medium)
41-
1. [Permutation of Letters](https://github.com/openset/leetcode/tree/master/problems/permutation-of-letters) (Medium)
41+
1. [Brace Expansion](https://github.com/openset/leetcode/tree/master/problems/brace-expansion) (Medium)

problems/letter-tile-possibilities/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@
4040
<li><code>1 &lt;= tiles.length &lt;= 7</code></li>
4141
<li><code>tiles</code> consists of uppercase English letters.</li>
4242
</ol>
43+
44+
### Related Topics
45+
[[Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)]
46+
47+
### Hints
48+
<details>
49+
<summary>Hint 1</summary>
50+
Try to build the string with a backtracking DFS by considering what you can put in every position.
51+
</details>

problems/lfu-cache/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ cache.get(4); // returns 4
4343
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)]
4444

4545
### Similar Questions
46-
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Hard)
46+
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Medium)
4747
1. [Design In-Memory File System](https://github.com/openset/leetcode/tree/master/problems/design-in-memory-file-system) (Hard)

problems/longest-harmonious-subsequence/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
## 594. Longest Harmonious Subsequence (Easy)
1313

14-
<p>We define a harmonious array is an array where the difference between its maximum value and its minimum value is <b>exactly</b> 1.</p>
14+
<p>We define a harmounious array as an array where the difference between its maximum value and its minimum value is <b>exactly</b> 1.</p>
1515

1616
<p>Now, given an integer array, you need to find the length of its longest harmonious subsequence among all its possible <a href="https://en.wikipedia.org/wiki/Subsequence">subsequences</a>.</p>
1717

18-
<p><b>Example 1:</b><br />
18+
<p><b>Example 1:</b></p>
19+
1920
<pre>
2021
<b>Input:</b> [1,3,2,2,5,2,3,7]
2122
<b>Output:</b> 5
2223
<b>Explanation:</b> The longest harmonious subsequence is [3,2,2,2,3].
2324
</pre>
24-
</p>
2525

26-
<p><b>Note:</b>
27-
The length of the input array will not exceed 20,000.
28-
</p>
26+
<p>&nbsp;</p>
27+
28+
<p><b>Note:</b> The length of the input array will not exceed 20,000.</p>
2929

3030
### Related Topics
3131
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]

problems/occurrences-after-bigram/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@
4343
<li><code>first</code> and <code>second</code> consist of lowercase English letters.</li>
4444
</ol>
4545
</div>
46+
47+
### Related Topics
48+
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]
49+
50+
### Hints
51+
<details>
52+
<summary>Hint 1</summary>
53+
Split the string into words, then look at adjacent triples of words.
54+
</details>

0 commit comments

Comments
 (0)