From f25ca448697c5641dffd937549a033ab9c2361c7 Mon Sep 17 00:00:00 2001
From: Max Nilsson <97mani97@gmail.com>
Date: Sun, 22 Dec 2024 06:43:04 +0000
Subject: [PATCH] Found my bug. Crazy that my previous code produced the right
 answer for the real input ...

---
 day 22/day_22_max_n.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/day 22/day_22_max_n.cpp b/day 22/day_22_max_n.cpp
index ad95d97..8e38551 100644
--- a/day 22/day_22_max_n.cpp	
+++ b/day 22/day_22_max_n.cpp	
@@ -66,7 +66,7 @@ void solve() {
         rep(i, 1, sz(changes)-3) {
             ll x1 = changes[i], x2 = changes[i+1], x3 = changes[i+2], x4 = changes[i+3];
             string s = to_string(x1) + "," + to_string(x2) + "," +to_string(x3) + "," + to_string(x4);
-            if (mp.count(s) == 0) mp[s] = lasts[i-1];
+            if (mp.count(s) == 0) mp[s] = lasts[i+3];
         }
 
         for (auto p : mp) tot[p.first] += p.second;
-- 
GitLab