![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法刷题
文章平均质量分 71
我写bug贼6
这个作者很懒,什么都没留下…
展开
-
Leetcode-209 长度最小的子数组 ----巧用双指针和滑动窗口 [Minimum Size Subarray Sum]
Leetcode-209 [Minimum Size Subarray Sum] 长度最小的子数组题目描述:给定一个含有 n 个正整数的数组 nums 和一个正整数 target ,找出该数组中满足其和 ≥ target 的长度最小的 连续 子数组,并返回其长度。如果不存在符合条件的子数组,返回 0。示例:输入:target = 7, nums = [2,3,1,2,4,3] 输出:2 解释:子数组 [4,3] 是该条件下的长度最小的子数组。题目链接: https://leetcode-cn.co原创 2021-08-20 19:11:23 · 78 阅读 · 0 评论 -
Leetcode-7 整数反转 ---- python3 中的 “%“ 和 “//“ 运算 [Reverse Integer]
Leetcode-7 python3 中的 “%” 和 “//” 运算leetcode-7应该很少有比这看起来更简单的题目了吧~~~思路一:转为字符串处理 (这就是我。。。)class Solution: def reverse(self, x: int) -> int: while abs(x)>0 and x % 10 ==0: x //= 10 if x<0: x = '-'+s原创 2021-04-06 21:23:40 · 144 阅读 · 1 评论 -
Leetcode-34 在排序数组中查找元素的第一个和最后一个位置 ----二分查找 python3
Leetcode-34 [Find First and Last Position of Element in Sorted Array]在排序数组中查找元素的第一个和最后一个位置CompaniesGiven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.If target is not found in the ar原创 2021-07-22 20:36:39 · 62 阅读 · 0 评论