![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
wachhu
这个作者很懒,什么都没留下…
展开
-
Leetcode 560. 和为K的子数组
560. 和为K的子数组 一开始用的穷举,超时了 class Solution: def subarraySum(self, nums: List[int], k: int) -> int: counter=0 for i in range(len(nums)): sum=0 a=i while a<=len(nums)-1: sum=sum+nums[原创 2020-05-15 06:29:04 · 141 阅读 · 0 评论 -
Leetcode 26. 删除排序数组中的重复项 11. 盛最多水的容器
尝试了两种方法,第一种超越了99.75%的解,看了一下前面的好像没有删除操作。 双指针方法 class Solution: def removeDuplicates(self, nums: List[int]) -> int: j=1 for i in range(1,len(nums)): if (nums[i]!=num...原创 2020-05-03 10:58:25 · 114 阅读 · 0 评论