随笔分类 -  leetcode

刷力扣
摘要:def findSubArray(nums): N = len(nums) # 数组/字符串长度 left, right = 0, 0 # 双指针,表示当前遍历的区间[left, right],闭区间 sums = 0 # 用于统计 子数组/子区间 是否有效,根据题目可能会改成求和/计数 res = 阅读全文
posted @ 2021-02-19 09:47 王猪猴 阅读(28) 评论(0) 推荐(0) 编辑
摘要:模板一 def binarySearch(nums, target): """ :type nums: List[int] :type target: int :rtype: int """ if len(nums) == 0: return -1 left, right = 0, len(nums 阅读全文
posted @ 2021-02-15 12:12 王猪猴 阅读(21) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示