From 607cb130a3474ca21fe43b6a3270daa4c8376977 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 8 Dec 2021 11:35:50 -0600 Subject: [PATCH] Cleanup --- 2021/eight.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2021/eight.nim b/2021/eight.nim index d99ce8a..8ba56af 100644 --- a/2021/eight.nim +++ b/2021/eight.nim @@ -3,7 +3,7 @@ import ./common, std/[strutils, sequtils, strformat, sugar, sets, math] proc parseLine(s: string): seq[seq[string]] = s.split(" | ").mapIt(it.split(" ")) proc p1(c: seq[string]): int = - c.reduce((a: int, l: string) => + c.reduce((a: int, l) => a + l.parseLine()[1].reduce((b: int, h) => b + int(h.len() in [2, 3, 4, 7]), 0), 0) proc numShared(s1: string, s2: string): int = (s1.toHashSet() * s2.toHashSet()).len()