From 4091b2c9f0739f634a0834fc553ac18df40bbf41 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 11 Dec 2020 09:40:57 -0600 Subject: [PATCH] Add 2020 Day 6, would not have been possible without the help of gvieira #4130 on discord --- 2020/day6.ahk | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 2020/day6.ahk diff --git a/2020/day6.ahk b/2020/day6.ahk new file mode 100644 index 0000000..2f51c05 --- /dev/null +++ b/2020/day6.ahk @@ -0,0 +1,6 @@ +for _, group in StrSplit(FileOpen("data6.txt","R").Read(),"`r`n`r`n") + Loop 26 { + p1 += !!RegExMatch(group,chr(96 + A_Index)) + p2 += !!RegExMatch(group,"s)(" chr(96 + A_Index) ".*){" StrSplit(group,"`n").Length() "}") +} +Msgbox % "Part 1: " p1 "`nPart 2: " p2 \ No newline at end of file