Quant Memo
Coding/●●●●●

Enumerate every clear path across a blocked grid

A grid marks each cell as open (0) or blocked (1). Starting at the top-left, move only right or down to reach the bottom-right, never entering a blocked cell. List every valid route as a string of moves (D = down, R = right).

grid = [[0, 0, 0],
        [0, 1, 0],
        [0, 0, 0]]
-> ["DDRR", "RRDD"]     # the two routes that skirt the blocked center

Return all right/down paths that avoid blocked cells.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions