From 7ef16e556f03474bfadddfdea366164277f9e4bc Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Tue, 6 Dec 2022 16:04:17 +1030 Subject: [PATCH] golfed on demand, python is bad at golf --- 2022/day6-mini.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 2022/day6-mini.py diff --git a/2022/day6-mini.py b/2022/day6-mini.py new file mode 100644 index 0000000..a8f790f --- /dev/null +++ b/2022/day6-mini.py @@ -0,0 +1,7 @@ +l=open('input/6','r').read() +def s(n): + for i in range(n,len(l)): + if len(set(l[i-n:i]))==n: + return print(i) +s(4) +s(14) \ No newline at end of file