diff --git a/problems/1365.有多少小于当前数字的数字.md b/problems/1365.有多少小于当前数字的数字.md index 22dd3226..95a270ff 100644 --- a/problems/1365.有多少小于当前数字的数字.md +++ b/problems/1365.有多少小于当前数字的数字.md @@ -144,13 +144,13 @@ public int[] smallerNumbersThanCurrent(int[] nums) { class Solution: def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]: res = nums[:] - hash = dict() + hash_dict = dict() res.sort() # 从小到大排序之后,元素下标就是小于当前数字的数字 for i, num in enumerate(res): - if num not in hash.keys(): # 遇到了相同的数字,那么不需要更新该 number 的情况 - hash[num] = i + if num not in hash_dict.keys(): # 遇到了相同的数字,那么不需要更新该 number 的情况 + hash_dict[num] = i for i, num in enumerate(nums): - res[i] = hash[num] + res[i] = hash_dict[num] return res ```