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
+13-7
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,12 @@ LeetCode Problems' Solutions
62
62
63
63
| # | Title | Solution | Difficulty |
64
64
| :-: | - | - | :-: |
65
+
| <spanid="1369">1369</span> |[Get the Second Most Recent Activity](https://leetcode.com/problems/get-the-second-most-recent-activity) 🔒 |[MySQL](problems/get-the-second-most-recent-activity)| Hard |
66
+
| <spanid="1368">1368</span> |[Minimum Cost to Make at Least One Valid Path in a Grid](https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid"使网格图至少有一条有效路径的最小代价")|[Go](problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid)| Hard |
67
+
| <spanid="1367">1367</span> |[Linked List in Binary Tree](https://leetcode.com/problems/linked-list-in-binary-tree"二叉树中的列表")|[Go](problems/linked-list-in-binary-tree)| Medium |
68
+
| <spanid="1366">1366</span> |[Rank Teams by Votes](https://leetcode.com/problems/rank-teams-by-votes"通过投票对团队排名")|[Go](problems/rank-teams-by-votes)| Medium |
69
+
| <spanid="1365">1365</span> |[How Many Numbers Are Smaller Than the Current Number](https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number"有多少小于当前数字的数字")|[Go](problems/how-many-numbers-are-smaller-than-the-current-number)| Easy |
70
+
| <spanid="1364">1364</span> |[Number of Trusted Contacts of a Customer](https://leetcode.com/problems/number-of-trusted-contacts-of-a-customer"顾客的可信联系人数量") 🔒 |[MySQL](problems/number-of-trusted-contacts-of-a-customer)| Medium |
65
71
| <spanid="1363">1363</span> |[Largest Multiple of Three](https://leetcode.com/problems/largest-multiple-of-three"形成三的最大倍数")|[Go](problems/largest-multiple-of-three)| Hard |
66
72
| <spanid="1362">1362</span> |[Closest Divisors](https://leetcode.com/problems/closest-divisors"最接近的因数")|[Go](problems/closest-divisors)| Medium |
67
73
| <spanid="1361">1361</span> |[Validate Binary Tree Nodes](https://leetcode.com/problems/validate-binary-tree-nodes"验证二叉树")|[Go](problems/validate-binary-tree-nodes)| Medium |
@@ -75,7 +81,7 @@ LeetCode Problems' Solutions
75
81
| <spanid="1353">1353</span> |[Maximum Number of Events That Can Be Attended](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended"最多可以参加的会议数目")|[Go](problems/maximum-number-of-events-that-can-be-attended)| Medium |
76
82
| <spanid="1352">1352</span> |[Product of the Last K Numbers](https://leetcode.com/problems/product-of-the-last-k-numbers"最后 K 个数的乘积")|[Go](problems/product-of-the-last-k-numbers)| Medium |
77
83
| <spanid="1351">1351</span> |[Count Negative Numbers in a Sorted Matrix](https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix"统计有序矩阵中的负数")|[Go](problems/count-negative-numbers-in-a-sorted-matrix)| Easy |
78
-
| <spanid="1350">1350</span> |[Students With Invalid Departments](https://leetcode.com/problems/students-with-invalid-departments) 🔒 |[MySQL](problems/students-with-invalid-departments)| Easy |
84
+
| <spanid="1350">1350</span> |[Students With Invalid Departments](https://leetcode.com/problems/students-with-invalid-departments"院系无效的学生") 🔒 |[MySQL](problems/students-with-invalid-departments)| Easy |
79
85
| <spanid="1349">1349</span> |[Maximum Students Taking Exam](https://leetcode.com/problems/maximum-students-taking-exam"参加考试的最大学生数")|[Go](problems/maximum-students-taking-exam)| Hard |
80
86
| <spanid="1348">1348</span> |[Tweet Counts Per Frequency](https://leetcode.com/problems/tweet-counts-per-frequency"推文计数")|[Go](problems/tweet-counts-per-frequency)| Medium |
81
87
| <spanid="1347">1347</span> |[Minimum Number of Steps to Make Two Strings Anagram](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram"制造字母异位词的最小步骤数")|[Go](problems/minimum-number-of-steps-to-make-two-strings-anagram)| Medium |
@@ -89,7 +95,7 @@ LeetCode Problems' Solutions
89
95
| <spanid="1339">1339</span> |[Maximum Product of Splitted Binary Tree](https://leetcode.com/problems/maximum-product-of-splitted-binary-tree"分裂二叉树的最大乘积")|[Go](problems/maximum-product-of-splitted-binary-tree)| Medium |
90
96
| <spanid="1338">1338</span> |[Reduce Array Size to The Half](https://leetcode.com/problems/reduce-array-size-to-the-half"数组大小减半")|[Go](problems/reduce-array-size-to-the-half)| Medium |
91
97
| <spanid="1337">1337</span> |[The K Weakest Rows in a Matrix](https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix"方阵中战斗力最弱的 K 行")|[Go](problems/the-k-weakest-rows-in-a-matrix)| Easy |
92
-
| <spanid="1336">1336</span> |[Number of Transactions per Visit](https://leetcode.com/problems/number-of-transactions-per-visit) 🔒 |[MySQL](problems/number-of-transactions-per-visit)| Hard |
98
+
| <spanid="1336">1336</span> |[Number of Transactions per Visit](https://leetcode.com/problems/number-of-transactions-per-visit"每次访问的交易次数") 🔒 |[MySQL](problems/number-of-transactions-per-visit)| Hard |
93
99
| <spanid="1335">1335</span> |[Minimum Difficulty of a Job Schedule](https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule"工作计划的最低难度")|[Go](problems/minimum-difficulty-of-a-job-schedule)| Hard |
94
100
| <spanid="1334">1334</span> |[Find the City With the Smallest Number of Neighbors at a Threshold Distance](https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance"阈值距离内邻居最少的城市")|[Go](problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance)| Medium |
95
101
| <spanid="1333">1333</span> |[Filter Restaurants by Vegan-Friendly, Price and Distance](https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance"餐厅过滤器")|[Go](problems/filter-restaurants-by-vegan-friendly-price-and-distance)| Medium |
@@ -98,13 +104,13 @@ LeetCode Problems' Solutions
98
104
| <spanid="1330">1330</span> |[Reverse Subarray To Maximize Array Value](https://leetcode.com/problems/reverse-subarray-to-maximize-array-value"翻转子数组得到最大的数组值")|[Go](problems/reverse-subarray-to-maximize-array-value)| Hard |
99
105
| <spanid="1329">1329</span> |[Sort the Matrix Diagonally](https://leetcode.com/problems/sort-the-matrix-diagonally"将矩阵按对角线排序")|[Go](problems/sort-the-matrix-diagonally)| Medium |
100
106
| <spanid="1328">1328</span> |[Break a Palindrome](https://leetcode.com/problems/break-a-palindrome"破坏回文串")|[Go](problems/break-a-palindrome)| Medium |
101
-
| <spanid="1327">1327</span> |[List the Products Ordered in a Period](https://leetcode.com/problems/list-the-products-ordered-in-a-period) 🔒 |[MySQL](problems/list-the-products-ordered-in-a-period)| Easy |
107
+
| <spanid="1327">1327</span> |[List the Products Ordered in a Period](https://leetcode.com/problems/list-the-products-ordered-in-a-period"列出指定时间段内所有的下单产品") 🔒 |[MySQL](problems/list-the-products-ordered-in-a-period)| Easy |
102
108
| <spanid="1326">1326</span> |[Minimum Number of Taps to Open to Water a Garden](https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden"灌溉花园的最少水龙头数目")|[Go](problems/minimum-number-of-taps-to-open-to-water-a-garden)| Hard |
103
109
| <spanid="1325">1325</span> |[Delete Leaves With a Given Value](https://leetcode.com/problems/delete-leaves-with-a-given-value"删除给定值的叶子节点")|[Go](problems/delete-leaves-with-a-given-value)| Medium |
104
110
| <spanid="1324">1324</span> |[Print Words Vertically](https://leetcode.com/problems/print-words-vertically"竖直打印单词")|[Go](problems/print-words-vertically)| Medium |
| <spanid="1321">1321</span> |[Restaurant Growth](https://leetcode.com/problems/restaurant-growth"餐馆营业额变化增长") 🔒 |[MySQL](problems/restaurant-growth)| Medium |
108
114
| <spanid="1320">1320</span> |[Minimum Distance to Type a Word Using Two Fingers](https://leetcode.com/problems/minimum-distance-to-type-a-word-using-two-fingers"二指输入的的最小距离")|[Go](problems/minimum-distance-to-type-a-word-using-two-fingers)| Hard |
109
115
| <spanid="1319">1319</span> |[Number of Operations to Make Network Connected](https://leetcode.com/problems/number-of-operations-to-make-network-connected"连通网络的操作次数")|[Go](problems/number-of-operations-to-make-network-connected)| Medium |
110
116
| <spanid="1318">1318</span> |[Minimum Flips to Make a OR b Equal to c](https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c"或运算的最小翻转次数")|[Go](problems/minimum-flips-to-make-a-or-b-equal-to-c)| Medium |
@@ -117,7 +123,7 @@ LeetCode Problems' Solutions
117
123
| <spanid="1311">1311</span> |[Get Watched Videos by Your Friends](https://leetcode.com/problems/get-watched-videos-by-your-friends"获取你好友已观看的视频")|[Go](problems/get-watched-videos-by-your-friends)| Medium |
118
124
| <spanid="1310">1310</span> |[XOR Queries of a Subarray](https://leetcode.com/problems/xor-queries-of-a-subarray"子数组异或查询")|[Go](problems/xor-queries-of-a-subarray)| Medium |
119
125
| <spanid="1309">1309</span> |[Decrypt String from Alphabet to Integer Mapping](https://leetcode.com/problems/decrypt-string-from-alphabet-to-integer-mapping"解码字母到整数映射")|[Go](problems/decrypt-string-from-alphabet-to-integer-mapping)| Easy |
120
-
| <spanid="1308">1308</span> |[Running Total for Different Genders](https://leetcode.com/problems/running-total-for-different-genders) 🔒 |[MySQL](problems/running-total-for-different-genders)| Medium |
126
+
| <spanid="1308">1308</span> |[Running Total for Different Genders](https://leetcode.com/problems/running-total-for-different-genders"不同性别每日分数总计") 🔒 |[MySQL](problems/running-total-for-different-genders)| Medium |
121
127
| <spanid="1307">1307</span> |[Verbal Arithmetic Puzzle](https://leetcode.com/problems/verbal-arithmetic-puzzle"口算难题")|[Go](problems/verbal-arithmetic-puzzle)| Hard |
122
128
| <spanid="1306">1306</span> |[Jump Game III](https://leetcode.com/problems/jump-game-iii"跳跃游戏 III")|[Go](problems/jump-game-iii)| Medium |
123
129
| <spanid="1305">1305</span> |[All Elements in Two Binary Search Trees](https://leetcode.com/problems/all-elements-in-two-binary-search-trees"两棵二叉搜索树中的所有元素")|[Go](problems/all-elements-in-two-binary-search-trees)| Medium |
@@ -266,7 +272,7 @@ LeetCode Problems' Solutions
266
272
| <spanid="1162">1162</span> |[As Far from Land as Possible](https://leetcode.com/problems/as-far-from-land-as-possible"地图分析")|[Go](problems/as-far-from-land-as-possible)| Medium |
267
273
| <spanid="1161">1161</span> |[Maximum Level Sum of a Binary Tree](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree"最大层内元素和")|[Go](problems/maximum-level-sum-of-a-binary-tree)| Medium |
268
274
| <spanid="1160">1160</span> |[Find Words That Can Be Formed by Characters](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters"拼写单词")|[Go](problems/find-words-that-can-be-formed-by-characters)| Easy |
269
-
| <spanid="1159">1159</span> |[Market Analysis II](https://leetcode.com/problems/market-analysis-ii) 🔒 |[MySQL](problems/market-analysis-ii)| Hard |
275
+
| <spanid="1159">1159</span> |[Market Analysis II](https://leetcode.com/problems/market-analysis-ii"市场分析 II") 🔒 |[MySQL](problems/market-analysis-ii)| Hard |
270
276
| <spanid="1158">1158</span> |[Market Analysis I](https://leetcode.com/problems/market-analysis-i"市场分析 I") 🔒 |[MySQL](problems/market-analysis-i)| Medium |
271
277
| <spanid="1157">1157</span> |[Online Majority Element In Subarray](https://leetcode.com/problems/online-majority-element-in-subarray"子数组中占绝大多数的元素")|[Go](problems/online-majority-element-in-subarray)| Hard |
272
278
| <spanid="1156">1156</span> |[Swap For Longest Repeated Character Substring](https://leetcode.com/problems/swap-for-longest-repeated-character-substring"单字符重复子串的最大长度")|[Go](problems/swap-for-longest-repeated-character-substring)| Medium |
Copy file name to clipboardExpand all lines: problems/binary-search-tree-to-greater-sum-tree/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@
36
36
<p> </p>
37
37
</div>
38
38
39
-
<p><strong>Note:</strong></p>
39
+
<p><strong>Constraints:</strong></p>
40
40
41
41
<ol>
42
42
<li>The number of nodes in the tree is between <code>1</code> and <code>100</code>.</li>
@@ -46,7 +46,7 @@
46
46
47
47
<div>
48
48
<div>
49
-
<div> </div>
49
+
<div><strong>Note:</strong> This question is the same as 538: <ahref="https://leetcode.com/problems/convert-bst-to-greater-tree/">https://leetcode.com/problems/convert-bst-to-greater-tree/</a></div>
Copy file name to clipboardExpand all lines: problems/convert-bst-to-greater-tree/README.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,8 @@
13
13
14
14
<p>Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.</p>
15
15
16
-
<p>
17
-
<b>Example:</b>
16
+
<p><b>Example:</b></p>
17
+
18
18
<pre>
19
19
<b>Input:</b> The root of a Binary Search Tree like this:
20
20
5
@@ -26,7 +26,8 @@
26
26
/ \
27
27
20 13
28
28
</pre>
29
-
</p>
29
+
30
+
<p><strong>Note:</strong> This question is the same as 1038: <ahref="https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/">https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/</a></p>
[< Previous](../number-of-trusted-contacts-of-a-customer"Number of Trusted Contacts of a Customer")
9
+
10
+
[Next >](../rank-teams-by-votes"Rank Teams by Votes")
11
+
12
+
## [1365. How Many Numbers Are Smaller Than the Current Number (Easy)](https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number"有多少小于当前数字的数字")
13
+
14
+
<p>Given the array <code>nums</code>, for each <code>nums[i]</code> find out how many numbers in the array are smaller than it. That is, for each <code>nums[i]</code> you have to count the number of valid <code>j's</code> such that <code>j != i</code> <strong>and</strong> <code>nums[j] < nums[i]</code>.</p>
15
+
16
+
<p>Return the answer in an array.</p>
17
+
18
+
<p> </p>
19
+
<p><strong>Example 1:</strong></p>
20
+
21
+
<pre>
22
+
<strong>Input:</strong> nums = [8,1,2,2,3]
23
+
<strong>Output:</strong> [4,0,1,1,3]
24
+
<strong>Explanation:</strong>
25
+
For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3).
26
+
For nums[1]=1 does not exist any smaller number than it.
27
+
For nums[2]=2 there exist one smaller number than it (1).
28
+
For nums[3]=2 there exist one smaller number than it (1).
29
+
For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).
0 commit comments