[C++] |Simple|Easy to read and Unerstand
\nclass Solution {\npublic:\n    int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {\n        int m=languages.size()
```\nclass Solution {\npublic:\n    int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {\n        int m=languages.size();\n        //keep track if person can speak language already\n        vector<vector<bool>> can_speak(m+1,vector<bool>(n+1,false));\n        for(int i=0;i<m;i++){\n            for(int j=0;j<languages[i].size();j++){\n                can_speak[i+1][languages[i][j]]=true;\n            }\n        }\n        set<int> v;\n        for(int i=0;i<friendships.size();i++){\n            bool flag=true;\n            for(int j=1;j<=n;j++){\n                if(can_speak[friendships[i][0]][j]&&can_speak[friendships[i][1]][j]){\n                    flag=false;\n                    break;\n                }\n            }\n            //if need some common language\n            if(flag){\n                v.insert(friendships[i][0]);\n                v.insert(friendships[i][1]);\n            }\n        }\n        vector<int> cnt(n+1,0);\n        int ma=0;\n        //vote for your language\n        for(auto it:v){\n            for(int j=0;j<languages[it-1].size();j++){\n                cnt[languages[it-1][j]]++;\n                ma=max(ma,cnt[languages[it-1][j]]);\n            }\n        }\n        //others will learn \n        return v.size()-ma;;\n    }\n};\n```
['C']