codingAssignment2(B58)
codingAssignment2(B58)
s1_count = Counter(s1)
window_count = Counter(s2[:len(s1)])
if s1_count == window_count:
return True
if window_count[s2[i - len(s1)]] == 0:
del window_count[s2[i - len(s1)]]
if s1_count == window_count:
return True
return False
sol_perm = Solution()
print("Permutation in String:", sol_perm.checkInclusion("ab",
"eidbaooo"))
for char in s:
if char in mapping:
top_element = stack.pop() if stack else '#'
if mapping[char] != top_element:
return False
else:
stack.append(char)
return not stack
sol_valid = Solution()
print("Valid Parentheses:", sol_valid.isValid("()[]{}"))
for color in B:
if color_count[color] % 2 == 1:
return color