C++ Brute Force Solution
\nclass Solution {\npublic:\n    int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {\n        int ans = INT_MAX;\n  
```\nclass Solution {\npublic:\n    int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {\n        int ans = INT_MAX;\n        vector<set<int>>  lang;\n        set<int> stt;\n        lang.push_back(stt);\n        for(auto &x : languages)\n        {\n            set<int> st;\n            for(int &y : x)st.insert(y);\n            lang.push_back(st);\n        }\n        int m = languages.size();\n        vector<vector<bool>> IsCommon(m+1, vector<bool> (m+1, false));\n        \n        for(int i=1;i<=m;i++)\n        {\n            for(int j=i+1;j<=m;j++)\n            {\n                for(int k=1;k<=n;k++)\n                {\n                    if((lang[i].find(k) != lang[i].end()) && (lang[j].find(k) != lang[j].end()))\n                    {\n                        IsCommon[i][j] = true;\n                        IsCommon[j][i] = true;\n                        break;\n                    }\n                }\n            }\n        }\n        \n        for(int i=1;i<=n;i++)\n        {\n            int curr_ans = 0;\n            vector<bool> op(m+1, false);\n            for(auto &x : friendships)\n            {\n                if(IsCommon[x[0]][x[1]])continue;\n                else\n                {\n                    if((lang[x[0]].find(i) == lang[x[0]].end()) && (op[x[0]] == false))\n                    {\n                       op[x[0]] = true;\n                        curr_ans++;\n                    }\n                    if((lang[x[1]].find(i) == lang[x[1]].end()) && (op[x[1]] == false))\n                    {\n                        op[x[1]] = true;\n                        curr_ans++;\n                    }\n                }\n            }\n            ans = min(ans, curr_ans);\n        }\n        return ans;\n    }\n};\n```
['C']