diff options
Diffstat (limited to '2025/ocaml')
| -rw-r--r-- | 2025/ocaml/lib/application/d03p01.ml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/2025/ocaml/lib/application/d03p01.ml b/2025/ocaml/lib/application/d03p01.ml index 26319df..b63679e 100644 --- a/2025/ocaml/lib/application/d03p01.ml +++ b/2025/ocaml/lib/application/d03p01.ml @@ -1 +1,20 @@ +(** Day 3 Part 1 + Implementation Plan: + + For each line: + 1. Start with the tuple [(None, None)] + 2. Put the first two digits in the sequence into the tuple => [(Some m, Some n)] + 3. Walk the sequence + - IF the digit in the sequence is greater than the first element of the tuple + AND we are not looking at the last digit in the sequence, + replace the first element of the tuple with that digit and set the other digit to None. + - IF the digit in the sequence did not replace the first element of the tuple + AND the digit is greater than the second element of the tuple, + replace the second element of the tuple with that digit. + 4. Concat the elements of the tuple "string-wise" => [(Some m', Some n')] => [m' ^ n'] + 5. Cast to int + + Sum the result of each line + *) + let solve _ () = failwith "not started" |
