Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /