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
+32-1
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,37 @@ LeetCode Problems' Solutions
78
78
79
79
| # | Title | Solution | Difficulty |
80
80
| :-: | - | - | :-: |
81
+
| <spanid="2076">2076</span> |[Process Restricted Friend Requests](https://leetcode.com/problems/process-restricted-friend-requests"处理含限制条件的好友请求")|[Go](problems/process-restricted-friend-requests)| Hard |
82
+
| <spanid="2075">2075</span> |[Decode the Slanted Ciphertext](https://leetcode.com/problems/decode-the-slanted-ciphertext"解码斜向换位密码")|[Go](problems/decode-the-slanted-ciphertext)| Medium |
83
+
| <spanid="2074">2074</span> |[Reverse Nodes in Even Length Groups](https://leetcode.com/problems/reverse-nodes-in-even-length-groups"反转偶数长度组的节点")|[Go](problems/reverse-nodes-in-even-length-groups)| Medium |
84
+
| <spanid="2073">2073</span> |[Time Needed to Buy Tickets](https://leetcode.com/problems/time-needed-to-buy-tickets"买票需要的时间")|[Go](problems/time-needed-to-buy-tickets)| Easy |
| <spanid="2071">2071</span> |[Maximum Number of Tasks You Can Assign](https://leetcode.com/problems/maximum-number-of-tasks-you-can-assign"你可以安排的最多任务数目")|[Go](problems/maximum-number-of-tasks-you-can-assign)| Hard |
87
+
| <spanid="2070">2070</span> |[Most Beautiful Item for Each Query](https://leetcode.com/problems/most-beautiful-item-for-each-query"每一个查询的最大美丽值")|[Go](problems/most-beautiful-item-for-each-query)| Medium |
88
+
| <spanid="2069">2069</span> |[Walking Robot Simulation II](https://leetcode.com/problems/walking-robot-simulation-ii"模拟行走机器人 II")|[Go](problems/walking-robot-simulation-ii)| Medium |
89
+
| <spanid="2068">2068</span> |[Check Whether Two Strings are Almost Equivalent](https://leetcode.com/problems/check-whether-two-strings-are-almost-equivalent"检查两个字符串是否几乎相等")|[Go](problems/check-whether-two-strings-are-almost-equivalent)| Easy |
90
+
| <spanid="2067">2067</span> |[Number of Equal Count Substrings](https://leetcode.com/problems/number-of-equal-count-substrings) 🔒 |[Go](problems/number-of-equal-count-substrings)| Medium |
91
+
| <spanid="2066">2066</span> |[Account Balance](https://leetcode.com/problems/account-balance) 🔒 |[MySQL](problems/account-balance)| Medium |
92
+
| <spanid="2065">2065</span> |[Maximum Path Quality of a Graph](https://leetcode.com/problems/maximum-path-quality-of-a-graph"最大化一张图中的路径价值")|[Go](problems/maximum-path-quality-of-a-graph)| Hard |
93
+
| <spanid="2064">2064</span> |[Minimized Maximum of Products Distributed to Any Store](https://leetcode.com/problems/minimized-maximum-of-products-distributed-to-any-store"分配给商店的最多商品的最小值")|[Go](problems/minimized-maximum-of-products-distributed-to-any-store)| Medium |
94
+
| <spanid="2063">2063</span> |[Vowels of All Substrings](https://leetcode.com/problems/vowels-of-all-substrings"所有子字符串中的元音")|[Go](problems/vowels-of-all-substrings)| Medium |
95
+
| <spanid="2062">2062</span> |[Count Vowel Substrings of a String](https://leetcode.com/problems/count-vowel-substrings-of-a-string"统计字符串中的元音子字符串")|[Go](problems/count-vowel-substrings-of-a-string)| Easy |
96
+
| <spanid="2061">2061</span> |[Number of Spaces Cleaning Robot Cleaned](https://leetcode.com/problems/number-of-spaces-cleaning-robot-cleaned) 🔒 |[Go](problems/number-of-spaces-cleaning-robot-cleaned)| Medium |
97
+
| <spanid="2060">2060</span> |[Check if an Original String Exists Given Two Encoded Strings](https://leetcode.com/problems/check-if-an-original-string-exists-given-two-encoded-strings"同源字符串检测")|[Go](problems/check-if-an-original-string-exists-given-two-encoded-strings)| Hard |
98
+
| <spanid="2059">2059</span> |[Minimum Operations to Convert Number](https://leetcode.com/problems/minimum-operations-to-convert-number"转化数字的最小运算数")|[Go](problems/minimum-operations-to-convert-number)| Medium |
99
+
| <spanid="2058">2058</span> |[Find the Minimum and Maximum Number of Nodes Between Critical Points](https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points"找出临界点之间的最小和最大距离")|[Go](problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points)| Medium |
100
+
| <spanid="2057">2057</span> |[Smallest Index With Equal Value](https://leetcode.com/problems/smallest-index-with-equal-value"值相等的最小索引")|[Go](problems/smallest-index-with-equal-value)| Easy |
101
+
| <spanid="2056">2056</span> |[Number of Valid Move Combinations On Chessboard](https://leetcode.com/problems/number-of-valid-move-combinations-on-chessboard"棋盘上有效移动组合的数目")|[Go](problems/number-of-valid-move-combinations-on-chessboard)| Hard |
102
+
| <spanid="2055">2055</span> |[Plates Between Candles](https://leetcode.com/problems/plates-between-candles"蜡烛之间的盘子")|[Go](problems/plates-between-candles)| Medium |
103
+
| <spanid="2054">2054</span> |[Two Best Non-Overlapping Events](https://leetcode.com/problems/two-best-non-overlapping-events"两个最好的不重叠活动")|[Go](problems/two-best-non-overlapping-events)| Medium |
104
+
| <spanid="2053">2053</span> |[Kth Distinct String in an Array](https://leetcode.com/problems/kth-distinct-string-in-an-array"数组中第 K 个独一无二的字符串")|[Go](problems/kth-distinct-string-in-an-array)| Easy |
105
+
| <spanid="2052">2052</span> |[Minimum Cost to Separate Sentence Into Rows](https://leetcode.com/problems/minimum-cost-to-separate-sentence-into-rows) 🔒 |[Go](problems/minimum-cost-to-separate-sentence-into-rows)| Medium |
106
+
| <spanid="2051">2051</span> |[The Category of Each Member in the Store](https://leetcode.com/problems/the-category-of-each-member-in-the-store) 🔒 |[MySQL](problems/the-category-of-each-member-in-the-store)| Medium |
107
+
| <spanid="2050">2050</span> |[Parallel Courses III](https://leetcode.com/problems/parallel-courses-iii"并行课程 III")|[Go](problems/parallel-courses-iii)| Hard |
108
+
| <spanid="2049">2049</span> |[Count Nodes With the Highest Score](https://leetcode.com/problems/count-nodes-with-the-highest-score"统计最高分的节点数目")|[Go](problems/count-nodes-with-the-highest-score)| Medium |
109
+
| <spanid="2048">2048</span> |[Next Greater Numerically Balanced Number](https://leetcode.com/problems/next-greater-numerically-balanced-number"下一个更大的数值平衡数")|[Go](problems/next-greater-numerically-balanced-number)| Medium |
110
+
| <spanid="2047">2047</span> |[Number of Valid Words in a Sentence](https://leetcode.com/problems/number-of-valid-words-in-a-sentence"句子中的有效单词数")|[Go](problems/number-of-valid-words-in-a-sentence)| Easy |
111
+
| <spanid="2046">2046</span> |[Sort Linked List Already Sorted Using Absolute Values](https://leetcode.com/problems/sort-linked-list-already-sorted-using-absolute-values) 🔒 |[Go](problems/sort-linked-list-already-sorted-using-absolute-values)| Medium |
81
112
| <spanid="2045">2045</span> |[Second Minimum Time to Reach Destination](https://leetcode.com/problems/second-minimum-time-to-reach-destination"到达目的地的第二短时间")|[Go](problems/second-minimum-time-to-reach-destination)| Hard |
82
113
| <spanid="2044">2044</span> |[Count Number of Maximum Bitwise-OR Subsets](https://leetcode.com/problems/count-number-of-maximum-bitwise-or-subsets"统计按位或能得到最大值的子集数目")|[Go](problems/count-number-of-maximum-bitwise-or-subsets)| Medium |
83
114
| <spanid="2043">2043</span> |[Simple Bank System](https://leetcode.com/problems/simple-bank-system"简易银行系统")|[Go](problems/simple-bank-system)| Medium |
@@ -158,7 +189,7 @@ LeetCode Problems' Solutions
158
189
| <spanid="1968">1968</span> |[Array With Elements Not Equal to Average of Neighbors](https://leetcode.com/problems/array-with-elements-not-equal-to-average-of-neighbors"构造元素不等于两相邻元素平均值的数组")|[Go](problems/array-with-elements-not-equal-to-average-of-neighbors)| Medium |
159
190
| <spanid="1967">1967</span> |[Number of Strings That Appear as Substrings in Word](https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word"作为子字符串出现在单词中的字符串数目")|[Go](problems/number-of-strings-that-appear-as-substrings-in-word)| Easy |
160
191
| <spanid="1966">1966</span> |[Binary Searchable Numbers in an Unsorted Array](https://leetcode.com/problems/binary-searchable-numbers-in-an-unsorted-array) 🔒 |[Go](problems/binary-searchable-numbers-in-an-unsorted-array)| Medium |
161
-
| <spanid="1965">1965</span> |[Employees With Missing Information](https://leetcode.com/problems/employees-with-missing-information) 🔒 |[MySQL](problems/employees-with-missing-information)| Easy |
192
+
| <spanid="1965">1965</span> |[Employees With Missing Information](https://leetcode.com/problems/employees-with-missing-information"丢失信息的雇员") 🔒 |[MySQL](problems/employees-with-missing-information)| Easy |
162
193
| <spanid="1964">1964</span> |[Find the Longest Valid Obstacle Course at Each Position](https://leetcode.com/problems/find-the-longest-valid-obstacle-course-at-each-position"找出到每个位置为止最长的有效障碍赛跑路线")|[Go](problems/find-the-longest-valid-obstacle-course-at-each-position)| Hard |
163
194
| <spanid="1963">1963</span> |[Minimum Number of Swaps to Make the String Balanced](https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced"使字符串平衡的最小交换次数")|[Go](problems/minimum-number-of-swaps-to-make-the-string-balanced)| Medium |
164
195
| <spanid="1962">1962</span> |[Remove Stones to Minimize the Total](https://leetcode.com/problems/remove-stones-to-minimize-the-total"移除石子使总数最小")|[Go](problems/remove-stones-to-minimize-the-total)| Medium |
The first and third John's are the same person as they have the common email "[email protected]".
28
-
The second John and Mary are different people as none of their email addresses are used by other accounts.
27
+
The first and second John's are the same person as they have the common email "[email protected]".
28
+
The third John and Mary are different people as none of their email addresses are used by other accounts.
29
29
We could return these lists in any order, for example the answer [['Mary', '[email protected]'], ['John', '[email protected]'],
Copy file name to clipboardExpand all lines: problems/all-the-pairs-with-the-maximum-number-of-common-followers/README.md
+3
Original file line number
Diff line number
Diff line change
@@ -12,3 +12,6 @@
12
12
## [1951. All the Pairs With the Maximum Number of Common Followers (Medium)](https://leetcode.com/problems/all-the-pairs-with-the-maximum-number-of-common-followers"查询具有最多共同关注者的所有两两结对组")
<li><code>s</code> consists of digits, <code>'+'</code>, <code>'-'</code>, <code>'('</code>, <code>')'</code>, and <code>' '</code>.</li>
46
46
<li><code>s</code> represents a valid expression.</li>
47
-
<li><code>'+'</code> is not used as a unary operation.</li>
48
-
<li><code>'-'</code> could be used as a unary operation and in this case, it will not be used directly after a +ve or -ve signs (will be inside parentheses).</li>
47
+
<li><code>'+'</code> is <strong>not</strong> used as a unary operation (i.e., <code>"+1"</code> and <code>"+(2 + 3)"</code> is invalid).</li>
48
+
<li><code>'-'</code> could be used as a unary operation (i.e., <code>"-1"</code> and <code>"-(2 + 3)"</code> is valid).</li>
49
49
<li>There will be no two consecutive operators in the input.</li>
50
50
<li>Every number and running calculation will fit in a signed 32-bit integer.</li>
Copy file name to clipboardExpand all lines: problems/bulb-switcher-ii/README.md
+34-6
Original file line number
Diff line number
Diff line change
@@ -20,33 +20,60 @@
20
20
<li><strong>Button 4:</strong> Flips the status of all the bulbs with a label <code>j = 3k + 1</code> where <code>k = 0, 1, 2, ...</code> (i.e., <code>1, 4, 7, 10, ...</code>).</li>
21
21
</ul>
22
22
23
-
<p>You will press one of the four mentioned buttons exactly <code>presses</code> times.</p>
23
+
<p>You must make <strong>exactly</strong> <code>presses</code> button presses in total. For each press, you may pick <strong>any</strong> of the four buttons to press.</p>
24
24
25
-
<p>Given the two integers <code>n</code> and <code>presses</code>, return <em>the number of <strong>different statuses</strong> after pressing the four buttons <strong>exactly</strong> </em><code>presses</code><em> times</em>.</p>
25
+
<p>Given the two integers <code>n</code> and <code>presses</code>, return <em>the number of <strong>different possible statuses</strong> after performing all </em><code>presses</code><em> button presses</em>.</p>
26
26
27
27
<p> </p>
28
28
<p><strong>Example 1:</strong></p>
29
29
30
30
<pre>
31
31
<strong>Input:</strong> n = 1, presses = 1
32
32
<strong>Output:</strong> 2
33
-
<strong>Explanation:</strong> Status can be: [on], [off].
33
+
<strong>Explanation:</strong> Status can be:
34
+
- [off] by pressing button 1
35
+
- [on] by pressing button 2
34
36
</pre>
35
37
36
38
<p><strong>Example 2:</strong></p>
37
39
38
40
<pre>
39
41
<strong>Input:</strong> n = 2, presses = 1
40
42
<strong>Output:</strong> 3
41
-
<strong>Explanation:</strong> Status can be: [on, off], [off, on], [off, off].
43
+
<strong>Explanation:</strong> Status can be:
44
+
- [off, off] by pressing button 1
45
+
- [on, off] by pressing button 2
46
+
- [off, on] by pressing button 3
42
47
</pre>
43
48
44
49
<p><strong>Example 3:</strong></p>
45
50
46
51
<pre>
47
52
<strong>Input:</strong> n = 3, presses = 1
48
53
<strong>Output:</strong> 4
49
-
<strong>Explanation:</strong> Status can be: [off, on, off], [on, off, on], [off, off, off], [off, on, on].
54
+
<strong>Explanation:</strong> Status can be:
55
+
- [off, off, off] by pressing button 1
56
+
- [off, on, off] by pressing button 2
57
+
- [on, off, on] by pressing button 3
58
+
- [off, on, on] by pressing button 4
59
+
</pre>
60
+
61
+
<p><strong>Example 4:</strong></p>
62
+
63
+
<pre>
64
+
<strong>Input:</strong> n = 1, presses = 0
65
+
<strong>Output:</strong> 1
66
+
<strong>Explanation:</strong> Status can only be [on] since you cannot press any of the buttons.
0 commit comments