diff --git a/common_tags.py b/common_tags.py new file mode 100644 index 0000000..da631f8 --- /dev/null +++ b/common_tags.py @@ -0,0 +1,11 @@ +from __future__ import annotations + + +def find_common_tags(articles: list[dict[str, list[str]]]) -> set[str]: + if not articles: + return set() + + common_tags = articles[0]["tags"] + for article in articles[1:]: + common_tags = [tag for tag in common_tags if tag in article["tags"]] + return set(common_tags) \ No newline at end of file