Find duplicate rows
A feature store keeps a very wide table in sparse form. Entry k records that row row_ids[k], column col_ids[k] holds values[k]. Rows are numbered 0 to row_count minus 1, every entry names a row in that range, and no row and column pair is listed twice. Every cell that is not listed holds zero, and a listed cell is allowed to hold zero as well, which means exactly the same thing as not listing it at all. Column numbers reach into the billions, so the dense table is never built. Two rows are duplicates when every column holds the same value in both. Return the ascending list of rows that no other row duplicates. Return an empty list when row_count is 0.
unique_feature_rows(row_count: int, row_ids: list[int], col_ids: list[int], values: list[int]) → list[int][3,[0,1,2],[5,5,7],[4,4,4]]out[2][2,[0],[9],[0]]out[][3,[0,0,1,1,2],[7,2,2,7,7],[1,9,9,1,1]]out[2]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.
[3,[0,1,2],[5,5,7],[4,4,4]][2]not run yetsample[2,[0],[9],[0]][]not run yetsample[3,[0,0,1,1,2],[7,2,2,7,7],[1,9,9,1,1]][2]not run yetsample