A robot stands at the top-left cell of a rows x cols grid and moves only right or down to reach the bottom-right cell. Return the number of different paths. Return the answer modulo 10**9 + 7.
For rows = 3 and cols = 7 the answer is 28.
The starter code is a plain recursion. It is correct but too slow for big grids.
Example 1
Input:
unique_paths(3, 7)
Output:
28
Example 2
Input:
unique_paths(3, 2)
Output:
3
1 <= rows, cols <= 1000No results yet
Run your code to check it against the examples, or submit to run every test.