From 4a6e5c8b7baea288b8b1855a97d42d522212dcf0 Mon Sep 17 00:00:00 2001 From: Andrew Schneider Date: Sun, 7 Jul 2024 14:57:56 -0400 Subject: mathjax mod in README --- challenge-276/atschneid/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-276/atschneid/README.md b/challenge-276/atschneid/README.md index f8e48b2b33..de2cf02ed3 100644 --- a/challenge-276/atschneid/README.md +++ b/challenge-276/atschneid/README.md @@ -43,7 +43,7 @@ On first reading, I thought we were looking only at adjacent items. So I hacked Double checking the examples I saw that we weren't limited to adjacent pairs. Trickier. We could of course check all possible pairs of times for a $\mathcal{O}(n^2)$, but we wouldn't be happy with that! (Actually I my *cleverer* Prolog solution had worse performance than that, due to Prologisms, so I went back to a $\mathcal{O}(n^2)$ solution.) -So after some thinking and pondering, I made some observations: if $t_1 + t_2 \mod 24 = 0$ then $(t_1, t_2)$ constitutes a completed day, equivalently if $(t_1 \mod 24 + t_2 \mod 24) \mod 24 = 0$. So we could find all values modulo 24 and figure it out from there. +So after some thinking and pondering, I made some observations: if $t_1 + t_2 \bmod 24 = 0$ then $(t_1, t_2)$ constitutes a completed day, equivalently if $(t_1 \bmod 24 + t_2 \bmod 24) \bmod 24 = 0$. So we could find all values modulo 24 and figure it out from there. Let's see come code -- cgit