diff options
| author | DJ O'Leary <dijitol@proton.me> | 2026-06-27 00:11:43 +0200 |
|---|---|---|
| committer | DJ O'Leary <dijitol@proton.me> | 2026-06-27 00:11:43 +0200 |
| commit | 976048a85403fbb0751c34fa42703a3c47f6e918 (patch) | |
| tree | 46e321d8120c45e318ead66f60165b0b854c85a1 /ocaml/lib/application/d03p01.ml | |
| parent | 6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae (diff) | |
refactor!: change repo directory structure for ocaml
Diffstat (limited to 'ocaml/lib/application/d03p01.ml')
| -rw-r--r-- | ocaml/lib/application/d03p01.ml | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/ocaml/lib/application/d03p01.ml b/ocaml/lib/application/d03p01.ml deleted file mode 100644 index 522f5d0..0000000 --- a/ocaml/lib/application/d03p01.ml +++ /dev/null @@ -1,23 +0,0 @@ -open Domain.D03p01 - -let err_empty_input = "input is empty" - -let to_lines s = - s |> String.split_on_char '\n' |> List.map String.trim - |> List.filter (fun l -> l <> "") - -let solve input () = - if input = "" then Error err_empty_input - else - let answer = - input |> to_lines |> List.to_seq - |> Seq.map BatteryBank.of_string - |> Seq.mapi (fun idx bb -> - let joltage = BatteryBank.highest_joltage bb in - Logs.debug (fun m -> - m "%d line=%s highest_joltage=%d" (idx + 1) (BatteryBank.pp bb) - joltage ) ; - joltage ) - |> Seq.fold_left ( + ) 0 - in - Ok answer |
