diff options
-rw-r--r-- | Puzzle1Better.hs | 6 | ||||
-rw-r--r-- | README.md | 1 |
2 files changed, 1 insertions, 6 deletions
diff --git a/Puzzle1Better.hs b/Puzzle1Better.hs deleted file mode 100644 index f33d11a..0000000 --- a/Puzzle1Better.hs +++ /dev/null @@ -1,6 +0,0 @@ --- 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) -solve1 xs = solve 1 (digitToInt <$> xs) -solve2 xs = solve ((length xs) `div` 2) (digitToInt <$> xs) diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e21aba --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +My solutions to Advent of Code 2017 in Haskell. Licensed under GPL. |