aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Puzzle1Better.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/Puzzle1Better.hs b/Puzzle1Better.hs
index d8d0155..f33d11a 100644
--- a/Puzzle1Better.hs
+++ b/Puzzle1Better.hs
@@ -1,3 +1,4 @@
+-- source: https://www.reddit.com/r/adventofcode/comments/7gsrc2/2017_day_1_solutions/dqlhkcj/
import Data.Char (digitToInt)
solve n xs = sum $ zipWith (\a b -> if a == b then a else 0) xs (drop n $ cycle xs)