Question
A music service wants the songs that every one of its editorial playlists agrees on. Given a list of playlists, each a list of integer song ids (a playlist may repeat an id), return the ids that appear in every playlist, sorted ascending. If the outer list is empty, return an empty list; a single playlist returns its distinct ids sorted. For example, [[1, 2, 3], [2, 3, 4], [3, 2, 9]] returns [2, 3]. Intersecting lists pairwise with repeated scans is the slow path — count memberships instead.
common_to_all(playlists: list[list[int]]) → list[int][[[1,2,3],[2,3,4],[3,2,9]]]out[2,3]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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.