2D DP — Reasoning Check

Apply the module invariants, traces, and boundary conditions.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. A grid uses 1 for an obstacle and 0 for an open cell: [[0,0,1,0],[0,0,0,0],[0,1,0,0]]. How many paths go from top-left to bottom-right using only right and down moves? Enter one integer.
2. For costs [[2,8,1],[1,3,1],[4,1,2]], what is the minimum top-left-to-bottom-right path sum using only right and down moves and including both endpoint costs? Enter one integer.
3. A bottom-up triangle DP has lower-row costs [4,1,9] and current-row values [5,2]. Which in-place update order and resulting first two costs are correct?

Select one answer.

4. For edit distance from "cab" to "cb", the previous DP row E(2,j) is [2,1,1]. While computing E(3,2), which value is the diagonal predecessor and what result follows?

Select one answer.

5. Can s3="aaxyab" interleave s1="aab" and s2="axy" while preserving each source order?

Select one answer.

6. For the binary matrix with rows "1110", "1111", and "0111", what are the maximal-square side length ending at the bottom-right cell and the largest square area anywhere?

Select one answer.

Join Discord