|
@@ -1,11 +1,11 @@
|
|
|
#!/usr/bin/env python3
|
|
#!/usr/bin/env python3
|
|
|
import sys
|
|
import sys
|
|
|
-from collections import Counter, deque
|
|
|
|
|
|
|
+from collections import deque
|
|
|
|
|
|
|
|
def marker(stream, winlen):
|
|
def marker(stream, winlen):
|
|
|
window = deque(stream[:winlen - 1])
|
|
window = deque(stream[:winlen - 1])
|
|
|
for i, char in enumerate(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
|
|
return i + winlen
|
|
|
window.popleft()
|
|
window.popleft()
|
|
|
window.append(char)
|
|
window.append(char)
|