Question
A music app keeps a play log for one listening session: a list of song ids in the order they were played. The product team wants to surface the first song the listener played exactly once across the whole session. Given the log, return the id of the earliest-played song whose total play count is 1. If every song in the log was played more than once, or the log is empty, return an empty string. For example, in ["hills","echo","hills","nova"] the answer is "echo".
first_unique_song(plays: list[str]) → str[["hills","echo","hills","nova"]]out"echo"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.