Enumerate Grid Paths
Problem statement
Starting at the top-left cell of a rows-by-cols grid, move only down (D) or right (R) until the bottom-right cell. Return every path as a move string in lexicographic order.
Function
enumerateGridPaths(rows: int, cols: int) → String[]Examples
Example 1
rows = 2cols = 3return = ["DRR","RDR","RRD"]Example 2
rows = 1cols = 1return = [""]Constraints
1 <= rows, cols <= 8.