Algorithm · Google · Medium
For an m x n grid, determine how many distinct routes lead from the lower-left cell to the upper-right cell. On each move, you may go upward, move rightward, or travel diagonally upward and rightward. Implement unique_paths(m: int, n: int) -> int so it returns the total number of valid routes. You may assume both m and n fall within [1, 100]. Include test cases. Example There are five possible routes because reaching the opposite corner requires one upward displacement and…
Checking your access…