Shared distinct tags

Write codeEasy10 min

Your task

Two curators each maintain a tag list for their own playlist, and tags may repeat within either list. To measure how similar the playlists are, count how many distinct tags appear in both lists (the size of the intersection of their distinct tag sets). Repeats never add to the count. For example, ["rock", "pop", "jazz"] and ["pop", "jazz", "folk", "pop"] share the two tags "pop" and "jazz", so the answer is 2. Return the count as an integer.

Examples

shared_tag_count(a: list[str], b: list[str]) -> int
Example 1
Inputshared_tag_count(["rock", "pop", "jazz"], ["pop", "jazz", "folk", "pop"])
Output2