We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No description provided.
The text was updated successfully, but these errors were encountered:
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
Sorry, something went wrong.
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
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: