updated day 4
This commit is contained in:
parent
4192baf89c
commit
3262389afe
1 changed files with 0 additions and 3 deletions
|
|
@ -30,9 +30,6 @@ split delims (x:xs)
|
||||||
toTuple :: [a] -> (a, a)
|
toTuple :: [a] -> (a, a)
|
||||||
toTuple (x:(y:ys)) = (x, y)
|
toTuple (x:(y:ys)) = (x, y)
|
||||||
|
|
||||||
fromTuple :: (a, a) -> [a]
|
|
||||||
fromTuple (x, y) = [x, y]
|
|
||||||
|
|
||||||
splitInput :: String -> [(Integer, Integer)]
|
splitInput :: String -> [(Integer, Integer)]
|
||||||
splitInput text = map (\x -> toTuple $ map read x) $ map (filter (/="")) $ map (split ['|']) $ split ['\n'] text
|
splitInput text = map (\x -> toTuple $ map read x) $ map (filter (/="")) $ map (split ['|']) $ split ['\n'] text
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue