Python3 solution: logic + brute force
Intuition\n Describe your first thoughts on how to solve this problem. \nFirst intuition was graph, because the problem was framed like a graph problem\n# Appro
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFirst intuition was graph, because the problem was framed like a graph problem\n# Approach\n<!-- Describe your approach to solving the problem. -->\nSince constraints are rather small, brute force trial and error would suffice\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n * friendships.length)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(n + friendships.length)$$\n# Code\n```\n#\n# @lc app=leetcode id=1733 lang=python3\n#\n# [1733] Minimum Number of People to Teach\n#\n\n# @lc code=start\nfrom typing import List\n\n\nclass Solution:\n    \'\'\'\n    Note that friendships are not transitive, meaning if x is a friend of y and y is a friend of z, this doesn\'t guarantee that x is a friend of z. This means graph is not appropriate. Instead we should consider between each pair of friend, which language does not intersect. The language which got the most vote is the optimal answer \n    \'\'\'\n    def minimumTeachings(self, n: int, languages: List[List[int]], friendships: List[List[int]]) -> int:\n        lang = [set(l) for l in languages]\n        frds = [f for f in friendships if len(lang[f[0] - 1].intersection(lang[f[1] - 1])) == 0]\n        result = float(\'inf\')\n        for i in range(1, n + 1):\n            teach = set()\n            for u, v in frds:\n                if i not in lang[u - 1]:\n                    teach.add(u)\n                if i not in lang[v - 1]:\n                    teach.add(v)\n            result = min(result, len(teach)) \n        return result              \n# @lc code=end\n\n\n```
['Python3']