Repeated tags
A tagging tool lets editors attach genre tags to tracks, and the same tag can be applied many times across a library. Given the full list of applied tags (case-sensitive strings), return an alphabetically sorted list of the distinct tags that were applied more than once. Tags applied exactly once are excluded. For example, ["rock", "pop", "rock", "jazz", "pop"] yields ["pop", "rock"]. Return an empty list when nothing repeats.
Implement
repeated_tags(tags: list[str]) → list[str]Examples
in
[["rock","pop","rock","jazz","pop"]]out["pop","rock"]What a strong answer looks like
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.
0:00 of about 10 min
solution.py
InputExpectedGot
[["rock","pop","rock","jazz","pop"]]["pop","rock"]not run yetsample