From e1d3ca5ea261f771d5f5dfed902ecfd7f1784dea Mon Sep 17 00:00:00 2001 From: David Ashby Date: Wed, 16 Dec 2020 19:15:23 -0500 Subject: [PATCH] add some comments --- 16/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/16/main.go b/16/main.go index 0a2d30b..fc06188 100644 --- a/16/main.go +++ b/16/main.go @@ -209,6 +209,9 @@ func partTwo() { } guesses := guessFields(rules, tickets) var lastRuleSolved int + // iterate over the guesses list. on every iteration, only one field has only one rule remaining that's valid + // save it off into the rules list, then remove that rule from all fields. + // Luckily, we don't need any higher-order elimination logic. for i := 1; i < len(guesses); i++ { for i, g := range guesses { if len(g) == 1 {