From f7d040708067de25ae5e896333df6e03f5a960c4 Mon Sep 17 00:00:00 2001 From: Rasmus Malver Date: Tue, 6 Dec 2022 11:46:41 +0100 Subject: [PATCH] 06 golf 5 l --- 06/2022-12-06-golf.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 06/2022-12-06-golf.py diff --git a/06/2022-12-06-golf.py b/06/2022-12-06-golf.py new file mode 100644 index 0000000..a8e13e1 --- /dev/null +++ b/06/2022-12-06-golf.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +a=open("06/i").read() + +for x in [4,14]: + for i in range(x,len(a)): + if sum([a[i-x:i].count(y) for y in a[i-x:i]]) == x: + print(i) + break \ No newline at end of file