If a cell has an obstacle, the number of paths through that cell is 0. You cannot reach it or pass through it.
Critical: If the starting cell or ending cell has an obstacle, return 0 immediately. No paths exist.
For other cells: if obstacle, set . Otherwise, use the same formula: .