Deduplicate playlist
Your task
Two listeners merged their playlists by simple concatenation, so some songs now appear multiple times. Write a function that cleans the merged playlist: keep only the first occurrence of each song id and drop every later repeat, preserving the original order of those first occurrences. For example, ["a", "b", "a", "c", "b"] becomes ["a", "b", "c"]. The order of the surviving entries must not change, so sorting is not an option.
Examples
dedupe_playlist(songs: list[str]) -> list[str]Example 1
Input
dedupe_playlist(["a", "b", "a", "c", "b"])Output
["a", "b", "c"]