LeetCode Weekly Contest 313-315
Weekly 313
Weekly 313
Snowflake is a multi-tenant, transactional, secure, highly scalable and elastic system with full SQL support and built-in extensions for semi-structured and ...
1. Introducing Kubernetes
2409. Count Days Spent Together 这道题目在讨论区有很多人说stupid,自己一开始的实现也不是很优雅,不过它还是一道很好的考察区间相交的题目,区间相交有具体的公式 max(0, min(end1, end2) - max(start1, start2)) 我们可以根据这个公式进行...
2418. Sort the People 签到题,不多说 class Solution: def sortPeople(self, names: List[str], heights: List[int]) -> List[str]: if not names or not hei...
2413. Smallest Even Multiple 签到题 class Solution: def smallestEvenMultiple(self, n: int) -> int: for i in range(2, 2 * n + 1): if i...
2404. Most Frequent Even Element 签到题,直接用dict做 class Solution: def mostFrequentEven(self, nums: List[int]) -> int: if not nums: ret...
2399. Check Distances Between Same Letters 算是签到题,但是比较悲剧的是看错了题,直接返回了计算出的结果数组,其实要看的是结果和给定的数组是否一致 class Solution: def checkDistances(self, s: str, distance:...
2389. Longest Subsequence With Limited Sum 题目中提到了是subsequence,所以可以直接排序然后计算 class Solution: def answerQueries(self, nums: List[int], queries: List[int]) -...
Minimum Hours of Training to Win a Competition 这道题Contest的时候错了好几次,主要原因是太心急,没有认真理解题意就提交