Dynamic programming 2D: Count paths from the top-left to bottom-right of a rectangular 0/1 grid, moving only right or down and never entering a blocked cell marked 1.
Input: A JSON object { "grid": number[][] } containing only 0 and 1.
Output: A JSON integer path count.
Constraints:
- 0 <= rows, columns <= 500
- The grid is rectangular
- A blocked start or destination produces 0 paths
Read one JSON value from stdin and print exactly one JSON-serialized answer to stdout with no extra text.
Difficulty: MEDIUM. Variant: 2. Expect follow-up questions about complexity, edge cases, and alternative approaches.
Practice context
This coding (algo) exercise trains prompt interpretation, explicit assumptions, a concrete response, and a concise explanation of the decisions made. It is marked medium difficulty.
The signed-in workspace provides the tools required by the round, such as recor