两数之和 用了一次暴力法,结果显示时间超时。检查了一遍,运行结果没有错,就是单纯的时间复杂度高了最后尝试了一次hash表,倒是成功了。字典的确拥有着比列表更高效的查找效率。class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: n=len(nums) i... Other 2024-07-30 34 点赞 0 评论 51 浏览