NeetCode #736LC-576Medium2-D Dynamic Programming
← Back to All Problems#736 · #576 · Out of Boundary Paths(出界的路径数)
📌 Problem Statement & Constraints
A ball sits at
(startRow, startColumn) of an m x n grid. In one move it moves to one of the four adjacent cells. Return the number of distinct move sequences that take the ball out of the grid in at most maxMove moves, modulo 1e9+7. Constraints: 1 <= m, n <= 50, 0 <= maxMove <= 50, and the start cell is inside the grid.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!