ocaml: phase 5.1 max_product3.ml baseline (max product of 3, with negatives -> 300)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 22s
Sort, then compare two candidates: p1 = product of three largest values p2 = product of two smallest (potentially negative) values and the largest For [-10;-10;1;3;2]: sorted = [-10;-10;1;2;3] p1 = 3 * 2 * 1 = 6 p2 = (-10) * (-10) * 3 = 300 max = 300 Tests List.sort + Array.of_list + arr.(n-i) end-walk + candidate-pick via if-then-else. 104 baseline programs total.
This commit is contained in:
@@ -407,6 +407,12 @@ _Newest first._
|
||||
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
|
||||
'a tree`) with insert + in-order traversal. Tests parametric ADT,
|
||||
recursive match, List.append, List.fold_left.
|
||||
- 2026-05-09 Phase 5.1 — max_product3.ml baseline (max product of
|
||||
three from a list including negatives = 300). Sort, then compare
|
||||
product of three largest vs product of two smallest negatives and
|
||||
one largest. For [-10;-10;1;3;2]: 3*2*1 = 6 vs (-10)*(-10)*3 = 300.
|
||||
Tests List.sort + Array.of_list + arr.(n-i) end-walk + candidate
|
||||
compare. 104 baseline programs total.
|
||||
- 2026-05-09 Phase 5.1 — euler9.ml baseline (Project Euler #9, abc
|
||||
product for the unique Pythagorean triple with a+b+c=1000 →
|
||||
31875000). Naive triple loop times out under contention (10-min
|
||||
|
||||
Reference in New Issue
Block a user