Your question is Complete Shape Grid Rows Columns. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an n x n grid of strings representing shapes, fill every empty cell so that each row and each column contains every shape exactly once. Empty cells are marked with ".". You are also given a list shapes of length n containing the allowed distinct shape names. Return the completed grid. You may assume the input always has a unique valid solution.
def complete_shape_grid(grid, shapes):