clean commented code
the question is tricky to understand but easy to implement when you overcome that intial hurdle. \n\n\nclass Solution:\n    def minimumTeachings(self, n: int, l
the question is tricky to understand but easy to implement when you overcome that intial hurdle. \n\n```\nclass Solution:\n    def minimumTeachings(self, n: int, languages: List[List[int]], friendships: List[List[int]]) -> int:\n        # modify languages to be a set for quick intersection \n        languages = {person+1: set(language) for person, language in enumerate(languages)}  \n\n        # create a set of people with a language barrier between a friend\n        barrier = set() \n        for u, v in friendships:\n            if not languages[u] & languages[v]:\n                barrier.add(u)\n                barrier.add(v)\n\n        # count the spoken languages between people with barriers \n        spoken = Counter()\n        for person in barrier:\n            spoken += Counter(languages[person])\n\n        # teach the most common language to those who don\'t know it\n        return len(barrier) - max(spoken.values(), default=0)\n\n```
['Python3']