码迷,mamicode.com
首页 >  
搜索关键字:周赛    ( 244个结果
leetcode-168周赛-1295-统计位数为偶数的数字
题目描述: 方法一:O(N) class Solution: def findNumbers(self, nums: List[int]) -> int: ans=0 for num in nums: if len(str(num))%2==0: ans+=1 return ans 方法二:数学 O ...
分类:其他好文   时间:2019-12-25 20:43:12    阅读次数:85
leetcode-168周赛-1297-子串的最大出现次数
题目描述: 自己的提交: class Solution: def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int: c = collections.Counter() for i in range(l ...
分类:其他好文   时间:2019-12-25 17:47:39    阅读次数:137
leetcode-15双周赛-1288-删除被覆盖区间
题目描述: 方法一:排序O(Nlogn) class Solution: def removeCoveredIntervals(self, intervals: List[List[int]]) -> int: intervals.sort(key = lambda x:(x[0],-x[1])) ...
分类:其他好文   时间:2019-12-23 17:07:09    阅读次数:54
leetcode-15双周赛-1287-有序数组中出现次数超过25%的元素
题目描述: 方法一:二分法 class Solution: def findSpecialInteger(self, arr: List[int]) -> int: span = len(arr)//4 + 1 for i in range(0,len(arr),span): a = bisect. ...
分类:编程语言   时间:2019-12-23 17:06:53    阅读次数:85
leetcode-15双周赛-1286-字母组合迭代器
题目描述: 方法: class CombinationIterator: def __init__(self, characters: str, combinationLength: int): self.s = characters self.pos = [x for x in range(com ...
分类:其他好文   时间:2019-12-23 16:39:02    阅读次数:81
168场周赛
1.子串的最大出现次数 给你一个字符串 s ,请你返回满足以下条件且出现次数最大的 任意 子串的出现次数: 子串中不同字母的数目必须小于等于 maxLetters 。子串的长度必须大于等于 minSize 且小于等于 maxSize 。 示例 1: 输入:s = "aababcaab", maxLe ...
分类:其他好文   时间:2019-12-22 14:26:54    阅读次数:68
LeetCode-第 166 场周赛
LeetCode 第 166 场周赛 "1281.subtract the product and sum of digits of an integer" "1282.group the people given the group size they belong to" "1283.find ...
分类:其他好文   时间:2019-12-10 13:14:12    阅读次数:141
leetcode-165周赛-1275-找出井字棋的获胜者
题目描述: 自己的提交: class Solution: def tictactoe(self, moves: List[List[int]]) -> str: p = [[0] * 3 for _ in range(3)] if len(moves) < 5: return "Pending" f ...
分类:其他好文   时间:2019-12-02 19:11:51    阅读次数:70
leetcode-165周赛-1276-不浪费原料的汉堡制作方案
题目描述: 自己的提交: class Solution: def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]: t = (tomatoSlices - 2 * cheeseSlices) / 2 c = ...
分类:其他好文   时间:2019-12-02 18:55:17    阅读次数:78
leetcode-第14周双周赛-1273-删除树节点
题目描述: 自己的提交:动态规划 class Solution: def deleteTreeNodes(self, nodes: int, parent: List[int], value: List[int]) -> int: dp = [[0, 0]for _ in range(nodes)] ...
分类:其他好文   时间:2019-12-02 13:34:02    阅读次数:114
244条   上一页 1 ... 7 8 9 10 11 ... 25 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!