We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
class Solution(object): def minSubArrayLen(self, target, nums): globalMin = float('inf') curSum = 0 j = 0 for i in range(len(nums)): while j < len(nums) and curSum < target: curSum += nums[j] j += 1 if curSum >= target: globalMin = min(globalMin, j - i) curSum -= nums[i] return globalMin if globalMin != float('inf') else 0
class Solution(object): def lengthOfLongestSubstring(self, s): globalMax = -float('inf') globalSet = set() j = 0 for i in range(len(s)): while j < len(s) and s[j] not in globalSet: globalSet.add(s[j]) globalMax = max(globalMax, len(globalSet)) j += 1 globalSet.remove(s[i]) return globalMax if globalMax != -float('inf') else 0
Activity
tech-cow commentedon Feb 24, 2020
209. Minimum Size Subarray Sum
tech-cow commentedon Feb 24, 2020
3. Longest Substring Without Repeating Characters