Draw a checkerboard with rows rows and cols columns. Return a list of strings, one per row.
The top-left cell is #, and the pattern alternates between # and . both along each row and
down each column, exactly like the squares of a chessboard.
Examples
Input: rows = 2, cols = 3
Output: ["#.#", ".#."]
Input: rows = 1, cols = 1
Output: ["#"]
Constraints
0 <= rows, cols <= 40- If
rowsis0return[]; ifcolsis0returnrowsempty strings.
Goals
- Use two nested loops to visit every cell of a grid
- Decide a cell's character from its row and column