ocaml: phase 5.1 unique_paths_obs.ml baseline (4x4 grid w/ obstacles = 3)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 25s

Standard 2D unique-paths DP with obstacles gating each cell:

  dp[i][j] = if grid[i][j] = 1 then 0
             else dp[i-1][j] + dp[i][j-1]

Grid (1s are obstacles):
  . . . .
  . # . .
  . . . #
  # . . .

dp:
  1 1 1 1
  1 0 1 2
  1 1 2 0
  0 1 3 3

Returns dp[3][3] = 3.

Complements grid_paths.ml (no-obstacles version) — same DP shape
but obstacles zero out cells and reshape the path count.

199 baseline programs total.
This commit is contained in:
2026-05-11 05:14:47 +00:00
parent 8ab2f80615
commit 3ccce58e0a
3 changed files with 35 additions and 0 deletions

View File

@@ -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-11 Phase 5.1 — unique_paths_obs.ml baseline (count
monotone paths in 4×4 grid with obstacles at (1,1),(2,3),(3,0)
= 3). Standard 2D DP with obstacle gating: dp[i][j] = dp[i-1][j]
+ dp[i][j-1] when grid[i][j]=0, else 0. Complements grid_paths.ml
(no-obstacles version): the same DP but obstacles zero out
cells, reshaping the path count. 199 baseline programs total.
- 2026-05-11 Phase 5.1 — daily_temperatures.ml baseline (monotonic
decreasing stack of waiting days until warmer; sum over
[73;74;75;71;69;72;76;73] = 10). For each day i, pop all stack