aboutsummaryrefslogtreecommitdiff
path: root/2024/04/day04a.cpp
diff options
context:
space:
mode:
Diffstat (limited to '2024/04/day04a.cpp')
-rw-r--r--2024/04/day04a.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/2024/04/day04a.cpp b/2024/04/day04a.cpp
index 887ebef..d108dec 100644
--- a/2024/04/day04a.cpp
+++ b/2024/04/day04a.cpp
@@ -49,7 +49,7 @@ public:
49 cells = new char[M * N]; 49 cells = new char[M * N];
50 for (int i = 0; i < N; i++) 50 for (int i = 0; i < N; i++)
51 for (int j = 0; j < M; j++) 51 for (int j = 0; j < M; j++)
52 cells[N*i + j] = j < (int)lines[i].size() ? 52 cells[M*i + j] = j < (int)lines[i].size() ?
53 lines[i][j] : out_of_bound; 53 lines[i][j] : out_of_bound;
54 } 54 }
55 55
@@ -73,7 +73,7 @@ private:
73 auto [i, j] = p; 73 auto [i, j] = p;
74 if (i >= N || i < 0 || j >= M || j < 0) 74 if (i >= N || i < 0 || j >= M || j < 0)
75 return out_of_bound; 75 return out_of_bound;
76 return cells[N*i + j]; 76 return cells[M*i + j];
77 } 77 }
78}; 78};
79 79

Generated with cgit - Back to sebastiano.tronto.net