摘要:
#136. Single Numberclass Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ single=[] for i in range(len(nums)) 阅读全文
摘要:
class Solution(object): def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ n=len(nums) a=n/3 freq={} result=[] for i in nums: 阅读全文
摘要:
class Solution(object): def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ n=len(nums) a=n/2 if n>=2: freq={} for i in nums: i 阅读全文