Algorithm · Oracle · Medium
You are given a binary grid with $$m$$ rows and $$n$$ columns. A cell marked 1 is open and may be entered, while a cell marked 0 is blocked. A route starts at the top-left corner (0, 0) and ends at the bottom-right corner (m - 1, n - 1). At each step, you may move one cell to the right (R) or one cell downward (D). Encode each complete route as a string made up of R and D characters. Print every possible route from start to finish in lexicographic order. Since D is…
Checking your access…