摘要:
题目描述: 方法一:原地哈希 class Solution: def firstMissingPositive(self, nums: List[int]) -> int: n = len(nums) for i in range(n): if nums[i] <= 0: nums[i] = n + 阅读全文
摘要:
题目描述: 提交: class Solution: from typing import List def avoidFlood(self, rains: List[int]) -> List[int]: import heapq heap = [] res = [-1 if i != 0 else 阅读全文
摘要:
题目描述: 第一次提交: 有错 未找出问题 留坑 class Solution: def getFolderNames(self, names: List[str]) -> List[str]: res = [] dic = collections.Counter() for name in nam 阅读全文
摘要:
解:O(N) class Solution: def maxScoreSightseeingPair(self, A: List[int]) -> int: left, res = A[0], -1 for j in range(1, len(A)): res = max(res, left + A 阅读全文