aboutsummaryrefslogtreecommitdiffstats
path: root/day03
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-12-07 12:43:51 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2021-12-07 14:18:09 +0200
commit3142bbcc613f880a9356ac1c837e2902f12a168e (patch)
tree45859d8b08c09a1b90eb986ff8f388eb32d1693d /day03
parent38e975a00a4b4739bf3b818fd8632578660fa05b (diff)
Day 04
Diffstat (limited to 'day03')
-rw-r--r--day03/main.hs3
1 files changed, 0 insertions, 3 deletions
diff --git a/day03/main.hs b/day03/main.hs
index 3488d69..6b0b10b 100644
--- a/day03/main.hs
+++ b/day03/main.hs
@@ -14,9 +14,6 @@ convert (x : xs) = x + 2 * convert xs
toIntMatrix :: [[Char]] -> [[Int]]
toIntMatrix = map (map digitToInt)
-transpose :: [[a]] -> [[a]]
-transpose = getZipList . traverse ZipList
-
mostCommon :: [Int] -> Int
-- Appending [0, 1] is a hack to make maximumBy choose 1 in a tie due to semantics
mostCommon lst = maximumBy (comparing (\x -> length $ filter (x ==) lst)) (lst ++ [0, 1])