🟢 剑指 Offer 57 - II. 和为s的连续正数序列
LeetCode 提示
题目难度 简单
原题链接 🔗 leetcode
#
题解 1.pyclass Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: l, r = 0, len(nums)-1 while l < r: curSum = nums[l] + nums[r] if curSum == target: return [nums[l], nums[r]] if curSum > target: r -= 1 else: l += 1 return []