03 2020 档案

摘要:题目描述: 方法一:第一次提交:python暴力 O(N^2) class Solution: def lastRemaining(self, n: int, m: int) -> int: a = [i for i in range(n)] i = 0 while(len(a) > 1): i = 阅读全文
posted @ 2020-03-31 10:33 oldby 阅读(130) 评论(0) 推荐(0)
摘要:题目描述: python 回溯 +kmp next数组 class Solution: def findGoodStrings(self, n: int, s1: str, s2: str, evil: str) -> int: MOD = int(1e9 + 7) m = len(evil) or 阅读全文
posted @ 2020-03-30 16:15 oldby 阅读(214) 评论(0) 推荐(0)
摘要:题目描述: python提交: import collections class UndergroundSystem: def __init__(self): self.idloop = collections.defaultdict(list) self.count = collections.d 阅读全文
posted @ 2020-03-29 15:11 oldby 阅读(187) 评论(0) 推荐(0)
摘要:题目描述: python提交:O(N^3) class Solution: def numTeams(self, rating: List[int]) -> int: ans = 0 for i in range(len(rating)): for j in range(i,len(rating)) 阅读全文
posted @ 2020-03-29 14:57 oldby 阅读(153) 评论(0) 推荐(0)
摘要:题目描述: python提交: from typing import List import collections class Solution: def findLucky(self, arr: List[int]) -> int: dic = collections.Counter(arr) 阅读全文
posted @ 2020-03-29 14:39 oldby 阅读(129) 评论(0) 推荐(0)