diff options
| author | Andrew Schneider <atschneider@temple.edu> | 2024-07-07 14:57:56 -0400 |
|---|---|---|
| committer | Andrew Schneider <atschneider@temple.edu> | 2024-07-07 14:57:56 -0400 |
| commit | 4a6e5c8b7baea288b8b1855a97d42d522212dcf0 (patch) | |
| tree | 6d180091b801d6eb20f4c55ac22f450b645aa162 | |
| parent | 50e0acb02b08f3bf25e840405bb30759fc4c7df3 (diff) | |
| download | perlweeklychallenge-club-4a6e5c8b7baea288b8b1855a97d42d522212dcf0.tar.gz perlweeklychallenge-club-4a6e5c8b7baea288b8b1855a97d42d522212dcf0.tar.bz2 perlweeklychallenge-club-4a6e5c8b7baea288b8b1855a97d42d522212dcf0.zip | |
mathjax mod in README
| -rw-r--r-- | challenge-276/atschneid/README.md | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
