Python3 solution
\nclass Solution:\n    def minimumTeachings(self, n: int, languages: List[List[int]], friendships: List[List[int]]) -> int:\n        friends2commute = []\n     
```\nclass Solution:\n    def minimumTeachings(self, n: int, languages: List[List[int]], friendships: List[List[int]]) -> int:\n        friends2commute = []\n        for f1, f2 in friendships:\n            if not list(set(languages[f1 - 1]) & set(languages[f2 - 1])):\n                friends2commute.append([f1, f2])\n        if not friends2commute:\n            return 0\n\n        min_students = float(\'inf\')\n        for lang in range(1, n + 1):\n            cur_students = 0\n            already_know = set()\n            for f1, f2 in friends2commute:\n                if lang not in languages[f1 - 1] and f1 not in already_know:\n                    cur_students += 1\n                    already_know.add(f1)\n                if lang not in languages[f2 - 1] and f2 not in already_know:\n                    cur_students += 1\n                    already_know.add(f2)\n            min_students = min(min_students, cur_students)\n        return min_students\n```\n
[]