We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b94b44 commit 14223a2Copy full SHA for 14223a2
problems/1365.有多少小于当前数字的数字.md
@@ -144,13 +144,13 @@ public int[] smallerNumbersThanCurrent(int[] nums) {
144
class Solution:
145
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
146
res = nums[:]
147
- hash = dict()
+ hash_dict = dict()
148
res.sort() # 从小到大排序之后,元素下标就是小于当前数字的数字
149
for i, num in enumerate(res):
150
- if num not in hash.keys(): # 遇到了相同的数字,那么不需要更新该 number 的情况
151
- hash[num] = i
+ if num not in hash_dict.keys(): # 遇到了相同的数字,那么不需要更新该 number 的情况
+ hash_dict[num] = i
152
for i, num in enumerate(nums):
153
- res[i] = hash[num]
+ res[i] = hash_dict[num]
154
return res
155
```
156
0 commit comments