Free seat columns
Your task
A campus lecture hall keeps its booking chart as a grid of single character seats. Row 0 is the back row, and chart[r][c] holds '.' for a free seat, 'X' for a booked seat, or 'B' for a seat taken out of service. Rows can differ in length, because the hall narrows toward the stage, so a column that exists in one row may simply not exist in a shorter row. The events team wants the columns it can sell as one whole vertical block. Return the indices of every column that is free in every row, in ascending order. A column counts only when each row actually has a seat at that index and that seat is '.', so a column missing from any row cannot be sold as a block. A chart with no rows returns an empty list.
Examples
clear_seat_columns(chart: list[list[str]]) -> list[int]Example 1
Input
clear_seat_columns([[".", ".", "X", "."], [".", ".", "X", "."], [".", ".", ".", "."]])Output
[0, 1, 3]Example 2
Input
clear_seat_columns([["X", ".", "X"], [".", ".", "X"], [".", "X", "X"]])Output
[]Example 3
Input
clear_seat_columns([[".", ".", "."], [".", "."], [".", ".", "."]])Output
[0, 1]