1371. Find the Longest Substring Containing Vowels in Even Counts
## 思路
用bitmask紀錄當前aeiou的奇偶個數
hash table存mask第一次遇到的index
如果s[:j]的mask最早出現在index i
表示s[i+1:j] 之間的母音都是偶數個
## Code
```python
class Solution:
def findTheLongestSubstring(self, s: str) -> int:
first_seen = defaultdict(int)
first_seen[0] = -1
vowels = {}
for i, vowel in enumerate('aeiou'):
vowels[vowel] = 1 << i
res = mask = 0
for idx, ch in enumerate(s):
if ch in vowels:
mask ^= vowels[ch]
if mask not in first_seen:
first_seen[mask] = idx
else:
res = max(res, idx - first_seen[mask])
return res
```