2022 Day 6 Python benching (twice as fast as scala!)

This commit is contained in:
Luke Hubmayer-Werner 2022-12-06 18:02:00 +10:30
parent c043bcc5d7
commit 47bfab928a
1 changed files with 11 additions and 0 deletions

11
2022/day6-bench.py Normal file
View File

@ -0,0 +1,11 @@
l=open('input/6','r').read()
def s(n,skip=0):
for i in range(max(skip, n),len(l)):
if len(set(l[i-n:i]))==n:
return i
for i in range(100000):
four = s(4)
fourteen = s(14, four)
print(four)
print(fourteen)