From 745bb5c16f78929c9072f5ea95d231e2c8ed572c Mon Sep 17 00:00:00 2001 From: Alexander Avery Date: Mon, 2 Dec 2024 23:02:48 -0500 Subject: [PATCH] I know why it is wrong, but cannot fix now --- 2024/day02.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/2024/day02.go b/2024/day02.go index 439fc60..e3386bd 100644 --- a/2024/day02.go +++ b/2024/day02.go @@ -47,6 +47,14 @@ Scan: return printi(sum) } +// part 2 does not yet work because this code makes a false assumption. +// that assumption is that in order to fix a broken level, you can only skip the +// one that made it broken. +// +// this is not true because of the following level +// 5 6 3 2 +// 5 and 6 would be OK, so the algorithm will blame the 3 and attempt to skip it. +// the real solution however, is to skip the 6 because it would be fine if all descending func (d Day2) Part2(r io.Reader) string { s := bufio.NewScanner(r) var sum int