Sliding Window 滑動窗口
left = 0
right = 0
table = defaultdict(int)
while (right < len(arr)):
# Do something
table[arr[right]] += 1
right += 1
while (table[arr[right]] > 1):
# Do something
table[arr[left]] -= 1
left += 1Last updated