Tap here to switch tabs
Problem
Submissions

Problem: Create Grid With Exactly One Path

Try to solve the Create Grid With Exactly One Path problem.

Statement

You are given two integers m and n.

Construct and return an m ×\times n grid represented as a list of strings, where each character is either '.' denoting an empty cell or '#' denoting an obstacle, such that there is exactly 11 valid path from the top left cell (0,0)(0, 0) to the bottom right cell (m −1- 1, n −1- 1).

A valid path starts at (0,0)(0, 0), ends at (m −1- 1, n −1- 1), and moves only right or down through empty cells.

If multiple valid grids exist, return any of them.

Constraints:

  • 1≤1 \le m, n ≤25\le 25

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Create Grid With Exactly One Path

Try to solve the Create Grid With Exactly One Path problem.

Statement

You are given two integers m and n.

Construct and return an m ×\times n grid represented as a list of strings, where each character is either '.' denoting an empty cell or '#' denoting an obstacle, such that there is exactly 11 valid path from the top left cell (0,0)(0, 0) to the bottom right cell (m −1- 1, n −1- 1).

A valid path starts at (0,0)(0, 0), ends at (m −1- 1, n −1- 1), and moves only right or down through empty cells.

If multiple valid grids exist, return any of them.

Constraints:

  • 1≤1 \le m, n ≤25\le 25