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
+27-6
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,27 @@ LeetCode Problems' Solutions
78
78
79
79
| # | Title | Solution | Difficulty |
80
80
| :-: | - | - | :-: |
81
+
| <spanid="1840">1840</span> |[Maximum Building Height](https://leetcode.com/problems/maximum-building-height"最高建筑高度")|[Go](problems/maximum-building-height)| Hard |
82
+
| <spanid="1839">1839</span> |[Longest Substring Of All Vowels in Order](https://leetcode.com/problems/longest-substring-of-all-vowels-in-order"所有元音按顺序排布的最长子字符串")|[Go](problems/longest-substring-of-all-vowels-in-order)| Medium |
83
+
| <spanid="1838">1838</span> |[Frequency of the Most Frequent Element](https://leetcode.com/problems/frequency-of-the-most-frequent-element"最高频元素的频数")|[Go](problems/frequency-of-the-most-frequent-element)| Medium |
84
+
| <spanid="1837">1837</span> |[Sum of Digits in Base K](https://leetcode.com/problems/sum-of-digits-in-base-k"K 进制表示下的各位数字总和")|[Go](problems/sum-of-digits-in-base-k)| Easy |
85
+
| <spanid="1836">1836</span> |[Remove Duplicates From an Unsorted Linked List](https://leetcode.com/problems/remove-duplicates-from-an-unsorted-linked-list) 🔒 |[Go](problems/remove-duplicates-from-an-unsorted-linked-list)| Medium |
86
+
| <spanid="1835">1835</span> |[Find XOR Sum of All Pairs Bitwise AND](https://leetcode.com/problems/find-xor-sum-of-all-pairs-bitwise-and"所有数对按位与结果的异或和")|[Go](problems/find-xor-sum-of-all-pairs-bitwise-and)| Hard |
87
+
| <spanid="1834">1834</span> |[Single-Threaded CPU](https://leetcode.com/problems/single-threaded-cpu"单线程 CPU")|[Go](problems/single-threaded-cpu)| Medium |
88
+
| <spanid="1833">1833</span> |[Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars"雪糕的最大数量")|[Go](problems/maximum-ice-cream-bars)| Medium |
89
+
| <spanid="1832">1832</span> |[Check if the Sentence Is Pangram](https://leetcode.com/problems/check-if-the-sentence-is-pangram"判断句子是否为全字母句")|[Go](problems/check-if-the-sentence-is-pangram)| Easy |
90
+
| <spanid="1831">1831</span> |[Maximum Transaction Each Day](https://leetcode.com/problems/maximum-transaction-each-day) 🔒 |[MySQL](problems/maximum-transaction-each-day)| Medium |
91
+
| <spanid="1830">1830</span> |[Minimum Number of Operations to Make String Sorted](https://leetcode.com/problems/minimum-number-of-operations-to-make-string-sorted"使字符串有序的最少操作次数")|[Go](problems/minimum-number-of-operations-to-make-string-sorted)| Hard |
92
+
| <spanid="1829">1829</span> |[Maximum XOR for Each Query](https://leetcode.com/problems/maximum-xor-for-each-query"每个查询的最大异或值")|[Go](problems/maximum-xor-for-each-query)| Medium |
93
+
| <spanid="1828">1828</span> |[Queries on Number of Points Inside a Circle](https://leetcode.com/problems/queries-on-number-of-points-inside-a-circle"统计一个圆中点的数目")|[Go](problems/queries-on-number-of-points-inside-a-circle)| Medium |
94
+
| <spanid="1827">1827</span> |[Minimum Operations to Make the Array Increasing](https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing"最少操作使数组递增")|[Go](problems/minimum-operations-to-make-the-array-increasing)| Easy |
| <spanid="1825">1825</span> |[Finding MK Average](https://leetcode.com/problems/finding-mk-average"求出 MK 平均值")|[Go](problems/finding-mk-average)| Hard |
97
+
| <spanid="1824">1824</span> |[Minimum Sideway Jumps](https://leetcode.com/problems/minimum-sideway-jumps"最少侧跳次数")|[Go](problems/minimum-sideway-jumps)| Medium |
98
+
| <spanid="1823">1823</span> |[Find the Winner of the Circular Game](https://leetcode.com/problems/find-the-winner-of-the-circular-game"找出游戏的获胜者")|[Go](problems/find-the-winner-of-the-circular-game)| Medium |
99
+
| <spanid="1822">1822</span> |[Sign of the Product of an Array](https://leetcode.com/problems/sign-of-the-product-of-an-array"数组元素积的符号")|[Go](problems/sign-of-the-product-of-an-array)| Easy |
100
+
| <spanid="1821">1821</span> |[Find Customers With Positive Revenue this Year](https://leetcode.com/problems/find-customers-with-positive-revenue-this-year) 🔒 |[MySQL](problems/find-customers-with-positive-revenue-this-year)| Easy |
101
+
| <spanid="1820">1820</span> |[Maximum Number of Accepted Invitations](https://leetcode.com/problems/maximum-number-of-accepted-invitations) 🔒 |[Go](problems/maximum-number-of-accepted-invitations)| Medium |
81
102
| <spanid="1819">1819</span> |[Number of Different Subsequences GCDs](https://leetcode.com/problems/number-of-different-subsequences-gcds"序列中不同最大公约数的数目")|[Go](problems/number-of-different-subsequences-gcds)| Hard |
82
103
| <spanid="1818">1818</span> |[Minimum Absolute Sum Difference](https://leetcode.com/problems/minimum-absolute-sum-difference"绝对差值和")|[Go](problems/minimum-absolute-sum-difference)| Medium |
83
104
| <spanid="1817">1817</span> |[Finding the Users Active Minutes](https://leetcode.com/problems/finding-the-users-active-minutes"查找用户活跃分钟数")|[Go](problems/finding-the-users-active-minutes)| Medium |
@@ -93,7 +114,7 @@ LeetCode Problems' Solutions
93
114
| <spanid="1807">1807</span> |[Evaluate the Bracket Pairs of a String](https://leetcode.com/problems/evaluate-the-bracket-pairs-of-a-string"替换字符串中的括号内容")|[Go](problems/evaluate-the-bracket-pairs-of-a-string)| Medium |
94
115
| <spanid="1806">1806</span> |[Minimum Number of Operations to Reinitialize a Permutation](https://leetcode.com/problems/minimum-number-of-operations-to-reinitialize-a-permutation"还原排列的最少操作步数")|[Go](problems/minimum-number-of-operations-to-reinitialize-a-permutation)| Medium |
95
116
| <spanid="1805">1805</span> |[Number of Different Integers in a String](https://leetcode.com/problems/number-of-different-integers-in-a-string"字符串中不同整数的数目")|[Go](problems/number-of-different-integers-in-a-string)| Easy |
96
-
| <spanid="1804">1804</span> |[Implement Trie II (Prefix Tree)](https://leetcode.com/problems/implement-trie-ii-prefix-tree) 🔒 |[Go](problems/implement-trie-ii-prefix-tree)| Medium |
117
+
| <spanid="1804">1804</span> |[Implement Trie II (Prefix Tree)](https://leetcode.com/problems/implement-trie-ii-prefix-tree"实现 Trie (前缀树) II") 🔒 |[Go](problems/implement-trie-ii-prefix-tree)| Medium |
97
118
| <spanid="1803">1803</span> |[Count Pairs With XOR in a Range](https://leetcode.com/problems/count-pairs-with-xor-in-a-range"统计异或值在范围内的数对有多少")|[Go](problems/count-pairs-with-xor-in-a-range)| Hard |
98
119
| <spanid="1802">1802</span> |[Maximum Value at a Given Index in a Bounded Array](https://leetcode.com/problems/maximum-value-at-a-given-index-in-a-bounded-array"有界数组中指定下标处的最大值")|[Go](problems/maximum-value-at-a-given-index-in-a-bounded-array)| Medium |
99
120
| <spanid="1801">1801</span> |[Number of Orders in the Backlog](https://leetcode.com/problems/number-of-orders-in-the-backlog"积压订单中的订单总数")|[Go](problems/number-of-orders-in-the-backlog)| Medium |
@@ -114,7 +135,7 @@ LeetCode Problems' Solutions
114
135
| <spanid="1786">1786</span> |[Number of Restricted Paths From First to Last Node](https://leetcode.com/problems/number-of-restricted-paths-from-first-to-last-node"从第一个节点出发到最后一个节点的受限路径数")|[Go](problems/number-of-restricted-paths-from-first-to-last-node)| Medium |
115
136
| <spanid="1785">1785</span> |[Minimum Elements to Add to Form a Given Sum](https://leetcode.com/problems/minimum-elements-to-add-to-form-a-given-sum"构成特定和需要添加的最少元素")|[Go](problems/minimum-elements-to-add-to-form-a-given-sum)| Medium |
116
137
| <spanid="1784">1784</span> |[Check if Binary String Has at Most One Segment of Ones](https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones"检查二进制字符串字段")|[Go](problems/check-if-binary-string-has-at-most-one-segment-of-ones)| Easy |
117
-
| <spanid="1783">1783</span> |[Grand Slam Titles](https://leetcode.com/problems/grand-slam-titles) 🔒 |[MySQL](problems/grand-slam-titles)| Medium |
138
+
| <spanid="1783">1783</span> |[Grand Slam Titles](https://leetcode.com/problems/grand-slam-titles"大满贯数量") 🔒 |[MySQL](problems/grand-slam-titles)| Medium |
118
139
| <spanid="1782">1782</span> |[Count Pairs Of Nodes](https://leetcode.com/problems/count-pairs-of-nodes"统计点对的数目")|[Go](problems/count-pairs-of-nodes)| Hard |
119
140
| <spanid="1781">1781</span> |[Sum of Beauty of All Substrings](https://leetcode.com/problems/sum-of-beauty-of-all-substrings"所有子字符串美丽值之和")|[Go](problems/sum-of-beauty-of-all-substrings)| Medium |
120
141
| <spanid="1780">1780</span> |[Check if Number is a Sum of Powers of Three](https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three"判断一个数字是否可以表示成三的幂的和")|[Go](problems/check-if-number-is-a-sum-of-powers-of-three)| Medium |
| <spanid="1750">1750</span> |[Minimum Length of String After Deleting Similar Ends](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends"删除字符串两端相同字符后的最短长度")|[Go](problems/minimum-length-of-string-after-deleting-similar-ends)| Medium |
151
172
| <spanid="1749">1749</span> |[Maximum Absolute Sum of Any Subarray](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray"任意子数组和的绝对值的最大值")|[Go](problems/maximum-absolute-sum-of-any-subarray)| Medium |
152
173
| <spanid="1748">1748</span> |[Sum of Unique Elements](https://leetcode.com/problems/sum-of-unique-elements"唯一元素的和")|[Go](problems/sum-of-unique-elements)| Easy |
153
-
| <spanid="1747">1747</span> |[Leetflex Banned Accounts](https://leetcode.com/problems/leetflex-banned-accounts) 🔒 |[MySQL](problems/leetflex-banned-accounts)| Medium |
154
-
| <spanid="1746">1746</span> |[Maximum Subarray Sum After One Operation](https://leetcode.com/problems/maximum-subarray-sum-after-one-operation) 🔒 |[Go](problems/maximum-subarray-sum-after-one-operation)| Medium |
174
+
| <spanid="1747">1747</span> |[Leetflex Banned Accounts](https://leetcode.com/problems/leetflex-banned-accounts"应该被禁止的Leetflex账户") 🔒 |[MySQL](problems/leetflex-banned-accounts)| Medium |
175
+
| <spanid="1746">1746</span> |[Maximum Subarray Sum After One Operation](https://leetcode.com/problems/maximum-subarray-sum-after-one-operation"经过一次操作后的最大子数组和") 🔒 |[Go](problems/maximum-subarray-sum-after-one-operation)| Medium |
155
176
| <spanid="1745">1745</span> |[Palindrome Partitioning IV](https://leetcode.com/problems/palindrome-partitioning-iv"回文串分割 IV")|[Go](problems/palindrome-partitioning-iv)| Hard |
156
177
| <spanid="1744">1744</span> |[Can You Eat Your Favorite Candy on Your Favorite Day?](https://leetcode.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day"你能在你最喜欢的那天吃到你最喜欢的糖果吗?")|[Go](problems/can-you-eat-your-favorite-candy-on-your-favorite-day)| Medium |
157
178
| <spanid="1743">1743</span> |[Restore the Array From Adjacent Pairs](https://leetcode.com/problems/restore-the-array-from-adjacent-pairs"从相邻元素对还原数组")|[Go](problems/restore-the-array-from-adjacent-pairs)| Medium |
158
179
| <spanid="1742">1742</span> |[Maximum Number of Balls in a Box](https://leetcode.com/problems/maximum-number-of-balls-in-a-box"盒子中小球的最大数量")|[Go](problems/maximum-number-of-balls-in-a-box)| Easy |
159
-
| <spanid="1741">1741</span> |[Find Total Time Spent by Each Employee](https://leetcode.com/problems/find-total-time-spent-by-each-employee) 🔒 |[MySQL](problems/find-total-time-spent-by-each-employee)| Easy |
180
+
| <spanid="1741">1741</span> |[Find Total Time Spent by Each Employee](https://leetcode.com/problems/find-total-time-spent-by-each-employee"查找每个员工花费的总时间") 🔒 |[MySQL](problems/find-total-time-spent-by-each-employee)| Easy |
160
181
| <spanid="1740">1740</span> |[Find Distance in a Binary Tree](https://leetcode.com/problems/find-distance-in-a-binary-tree"找到二叉树中的距离") 🔒 |[Go](problems/find-distance-in-a-binary-tree)| Medium |
161
182
| <spanid="1739">1739</span> |[Building Boxes](https://leetcode.com/problems/building-boxes"放置盒子")|[Go](problems/building-boxes)| Hard |
162
183
| <spanid="1738">1738</span> |[Find Kth Largest XOR Coordinate Value](https://leetcode.com/problems/find-kth-largest-xor-coordinate-value"找出第 K 大的异或坐标值")|[Go](problems/find-kth-largest-xor-coordinate-value)| Medium |
@@ -166,7 +187,7 @@ LeetCode Problems' Solutions
166
187
| <spanid="1734">1734</span> |[Decode XORed Permutation](https://leetcode.com/problems/decode-xored-permutation"解码异或后的排列")|[Go](problems/decode-xored-permutation)| Medium |
167
188
| <spanid="1733">1733</span> |[Minimum Number of People to Teach](https://leetcode.com/problems/minimum-number-of-people-to-teach"需要教语言的最少人数")|[Go](problems/minimum-number-of-people-to-teach)| Medium |
168
189
| <spanid="1732">1732</span> |[Find the Highest Altitude](https://leetcode.com/problems/find-the-highest-altitude"找到最高海拔")|[Go](problems/find-the-highest-altitude)| Easy |
169
-
| <spanid="1731">1731</span> |[The Number of Employees Which Report to Each Employee](https://leetcode.com/problems/the-number-of-employees-which-report-to-each-employee) 🔒 |[MySQL](problems/the-number-of-employees-which-report-to-each-employee)| Easy |
190
+
| <spanid="1731">1731</span> |[The Number of Employees Which Report to Each Employee](https://leetcode.com/problems/the-number-of-employees-which-report-to-each-employee"每位经理的下属员工数量") 🔒 |[MySQL](problems/the-number-of-employees-which-report-to-each-employee)| Easy |
170
191
| <spanid="1730">1730</span> |[Shortest Path to Get Food](https://leetcode.com/problems/shortest-path-to-get-food"获取食物的最短路径") 🔒 |[Go](problems/shortest-path-to-get-food)| Medium |
Copy file name to clipboardExpand all lines: problems/4sum-ii/README.md
+28-14
Original file line number
Diff line number
Diff line change
@@ -11,29 +11,43 @@
11
11
12
12
## [454. 4Sum II (Medium)](https://leetcode.com/problems/4sum-ii"四数相加 II")
13
13
14
-
<p>Given four lists A, B, C, D of integer values, compute how many tuples <code>(i, j, k, l)</code> there are such that <code>A[i] + B[j] + C[k] + D[l]</code> is zero.</p>
14
+
<p>Given four integer arrays <code>nums1</code>, <code>nums2</code>, <code>nums3</code>, and <code>nums4</code> all of length <code>n</code>, return the number of tuples <code>(i, j, k, l)</code> such that:</p>
15
15
16
-
<p>To make problem a bit easier, all A, B, C, D have same length of N where 0 ≤ N ≤ 500. All integers are in the range of -2<sup>28</sup> to 2<sup>28</sup> - 1 and the result is guaranteed to be at most 2<sup>31</sup> - 1.</p>
0 commit comments