def transpose(grid: list[list[str]]) -> list[list[str]]:
    """Transpose a grid

    Preconditions:
        - grid != []
        - grid[0] != []
        - all({len(row1) == len(row2) for row1 in grid for row2 in grid})
    """
    return [[grid[j][i] for j in range(len(grid))] for i in range(len(grid[0]))]