To reach cell , you must have come from either:
Cell - you moved down
Cell - you moved right
So the transition is: The paths from above plus the paths from the left. If either neighbor is out of bounds, treat it as 0. The transition is the core of any DP solution. For a blocked cell, setting ensures the formula handles walls automatically.