advent-of-code/2015/lean/Main.lean
2024-07-24 22:51:48 +02:00

12 lines
259 B
Plaintext

import «Aoc2015»
def asChange : Char -> Int
| '(' => 1
| ')' => -1
| _ => 0
def main : IO Unit := do
let hello <- IO.FS.readFile "../.inputs/01.txt"
let sum := hello |> String.toList |> List.map asChange |> List.foldl (.+.) 0
IO.println sum