Safe columns to drop
A data team exports a table as rows of string cells, every row the same width. They want to know which single columns carry no distinguishing information. Dropping column j is safe when it merges nothing: any two rows that differ somewhere before the drop still differ somewhere after it. Rows may repeat in the export, and a repeated row was already identical to its twin, so repeats never block a drop. Cells hold arbitrary text and may contain commas, pipes, quotes or any other character, so any scheme that glues a row into a single string has to stay unambiguous. Given the table, return the indices of every safe column, sorted ascending. Return an empty list when the table has no rows or no columns.
droppable_columns(rows: list[list[str]]) → list[int][[["a","1","x"],["a","2","x"],["b","1","x"]]]out[2][[["a","b"],["a","b"]]]out[0,1][[["one,two","three"],["one","two,three"]]]out[0,1]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
[[["a","1","x"],["a","2","x"],["b","1","x"]]][2]not run yetsample[[["a","b"],["a","b"]]][0,1]not run yetsample[[["one,two","three"],["one","two,three"]]][0,1]not run yetsample