aoc2023

advent of code 2023
Log | Files | Refs | Feed | README

Commit: 36dd1e38f2ba7590338c09833225b38808295653
Parent: cb2fb93130d8e170a1432877aaa849f0564f2c1a
Author: Randy Palamar
Date:   Fri,  1 Dec 2023 22:05:54 -0700

day1: include part 2 in comment

Diffstat:
M.gitignore | 4++--
Mday1/day1.hs | 12++++++++++--
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,4 @@ -**/day[0-9] -**/day[0-9][0-9] +*/day[0-9] +*/day[0-9][0-9] *.hi *.o diff --git a/day1/day1.hs b/day1/day1.hs @@ -1,13 +1,21 @@ --- AOC 2023: Day 1 Part 1 +-- AOC 2023: Day 1 -- Given a list of newline separated strings containing ASCII digits -- interspersed among other characters take the first and last ASCII -- digit from each line as a 2 digit number then sum all of them together -- --- Example: +-- Example (Part 1): -- treb7uchet -> 77 -- 1abc2 -> 12 -- (Output) 89 -- +-- Part 2: English names are also intersperced with the digits and +-- are also valid for making up the first and last digits. +-- +-- Example (Part 2): +-- 4nineeightseven2 -> 42 +-- zoneight234 -> 14 +-- (Output) 56 +-- import Data.Char import qualified Data.Text as T import qualified Data.Text.IO as TI