Copyright | (c) Eric Mertens 2023 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
https://adventofcode.com/2023/day/1
For each line in the input, create a two digit number from the first and last digits on the line, then sum up all of these numbers.
>>>
decode part1 <$> ["1abc2","pqr3stu8vwx","a1b2c3d4e5f","treb7uchet"]
[12,38,15,77]
>>>
decode part2 <$> ["two1nine","eightwothree","abcone2threexyz","xtwone3four","4nineeightseven2","zoneight234","7pqrstsixteen"]
[29,83,13,24,42,14,76]