Taddeus Kroes 3 лет назад
Родитель
Сommit
88f62f27cf
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      2022/06_packets.py

+ 2 - 2
2022/06_packets.py

@@ -1,11 +1,11 @@
 #!/usr/bin/env python3
 import sys
-from collections import Counter, deque
+from collections import deque
 
 def marker(stream, winlen):
     window = deque(stream[:winlen - 1])
     for i, char in enumerate(stream[winlen - 1:]):
-        if char not in window and len(Counter(window)) == winlen - 1:
+        if char not in window and len(set(window)) == winlen - 1:
             return i + winlen
         window.popleft()
         window.append(char)