摘要:
排序,返回中值。 class Solution: def majorityElement(self, nums: List[int]) -> int: #always exists nums.sort() return nums[len(nums)//2] 阅读全文
摘要:
原来leetcode使用Count也不需要import collections class Solution: def removeDuplicates(self, nums: List[int]) -> int: # len =0 if len(nums) == 0: return 0 # els 阅读全文
摘要:
开刷Top Interview 150 class Solution: def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: """ Do not return anything, modify nu 阅读全文