93% Time and 89% Space, 277 ms Simple Logic Explained
```\nclass Solution {\npublic:\n    #define pii pair\n    #define f first\n    #define s second\n    int minimumTeachings(int n, vector>& langs, vector>& conn) 
```\nclass Solution {\npublic:\n    #define pii pair<int,int>\n    #define f first\n    #define s second\n    int minimumTeachings(int n, vector<vector<int>>& langs, vector<vector<int>>& conn) {\n        \n        vector<int> allLang(n+1,0);\n        int m = conn.size();\n        vector<pii> graph;\n        int mx = 0;\n        for(int i=0; i<m; i++)\n        {\n            int start = conn[i][0];\n            int end = conn[i][1];\n            mx=0;//F**K YE GALAT THA\n            for(auto y:langs[start-1])\n                allLang[y]++;\n            for(auto y:langs[end-1])\n                allLang[y]++;\n            /*\n            for(auto y:allLang)\n                cout<<y<<" ";\n            cout<<endl;\n            */\n            for(auto &y:allLang)\n            {\n                mx = max(mx, y);\n                y = 0;//make this 0 so we can use the vector again\n            }\n            if(mx < 2)//this means that they don\'t have any language in common, so path which are able to communicate are excluded\n            {\n                graph.push_back({start,end});\n                //cout<<start<<" "<<end<<"\\t";\n            }\n        }\n        unordered_map<int,int> visited;//we use this so that connections having common people don\'t get their langauges added multiple times, they should get added only once\n        for(auto &p:graph)\n        {\n            if(visited[p.f]==0)\n            {\n                for(auto y:langs[p.f-1])\n                    allLang[y]++;\n                visited[p.f]=1;\n            }\n            if(visited[p.s]==0)\n            {\n                for(auto y:langs[p.s-1])\n                    allLang[y]++;\n                visited[p.s]=1;\n            }\n        }\n        int len = visited.size();\n        mx = *max_element(allLang.begin(),allLang.end());\n        //cout<<len<<" "<<mx<<endl;\n        return len - mx;//total people - people who known the most abundant language\n        \n        \n    }\n};\nAlgorithm:\n1. Break the path that are able to communicate \n2. then find the language which is most abundant, and then make sure that everyone knows that langauge
[]