summaryrefslogtreecommitdiff
path: root/2025/ocaml/lib/application/d03p02.ml
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2026-06-26 18:04:09 +0200
committerDJ O'Leary <dijitol@proton.me>2026-06-26 18:04:09 +0200
commit6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae (patch)
tree17c90d3984c114aa023600cc5bec6f6004b02243 /2025/ocaml/lib/application/d03p02.ml
parentad4ea5ca4bc9f7540ee1d6a4fa2d881709dc6459 (diff)
refactor!: invert repo directory structure
now is language first
Diffstat (limited to '2025/ocaml/lib/application/d03p02.ml')
-rw-r--r--2025/ocaml/lib/application/d03p02.ml23
1 files changed, 0 insertions, 23 deletions
diff --git a/2025/ocaml/lib/application/d03p02.ml b/2025/ocaml/lib/application/d03p02.ml
deleted file mode 100644
index 743c658..0000000
--- a/2025/ocaml/lib/application/d03p02.ml
+++ /dev/null
@@ -1,23 +0,0 @@
-open Domain.D03p02
-
-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