JS || Solution by Bharadwaj
Code\n\nvar minimumTeachings = function (n, languages, friendships) {\n    let mostSpokenLanguages = new Array(n + 1).fill(0);\n    let map = new Map();\n\n    
# Code\n```\nvar minimumTeachings = function (n, languages, friendships) {\n    let mostSpokenLanguages = new Array(n + 1).fill(0);\n    let map = new Map();\n\n    friendships.forEach((element) => {\n        let LANG = new Set(languages[element[0] - 1]);\n\n        let shareLang = false;\n        for (const l of languages[element[1] - 1]) {\n            if (LANG.has(l)) {\n                shareLang = true;\n                break;\n            }\n        }\n\n        if (!shareLang) {\n            map.set(element[0], languages[element[0] - 1]);\n            map.set(element[1], languages[element[1] - 1]);\n        }\n    });\n\n    map.forEach((value, key) => {\n        for (let l of value) ++mostSpokenLanguages[l]\n    });\n\n    return map.size - Math.max(...mostSpokenLanguages);\n};\n```
['JavaScript']