python 哈希表法有一处括号用错了: class Solution: def FindNumsAppearOnce(self , array: List[int]) -> List[int]: # write code here mp = dict() res = list() for i in range(len(array)): if array[i] in mp: mp[array[i]] += 1 else: mp[array[i]] = 1 # 遍历数组 for i in range(len(array)): if mp[array[i]] == 1: res.append(array[i]) return sorted(res)
点赞

相关推荐

不愿透露姓名的神秘牛友
07-03 18:13
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务