← 返回 apple 的题目列表Out of Boundary Paths
类型:qbank
There is an m x n grid with a ball. The ball starts at [startRow, startColumn]. On each move, the ball can move to an adjacent cell in one of four directions.
Examples
Example 1:
Input: m = 2, n = 2, maxMove = 2, startRow = 0, startColumn = 0
Output: 6
Example 2:
Input: m = 1, n = 3, maxMove = 3, startRow = 0, startColumn = 1
Output: 12
Constraints
1 <= m, n <= 50
0 <= maxMove <= 50
0 <= startRow < m
0 <= startColumn < n