There are
You are given an integer languages where languages[i] is the list of languages known by the friendships where friendships[j] = [] denotes a friendship between user
Two friends can communicate if there is at least one language that both of them know. You can choose exactly one language and teach it to some users.
Return the minimum number of users you need to teach that chosen language to ensure that every pair of friends can communicate.
Constraints:
languages.length
languages[i].length
languages[i][j]
languages.length
friendships.length
All pairs
languages[i] contains only unique values
There are
You are given an integer languages where languages[i] is the list of languages known by the friendships where friendships[j] = [] denotes a friendship between user
Two friends can communicate if there is at least one language that both of them know. You can choose exactly one language and teach it to some users.
Return the minimum number of users you need to teach that chosen language to ensure that every pair of friends can communicate.
Constraints:
languages.length
languages[i].length
languages[i][j]
languages.length
friendships.length
All pairs
languages[i] contains only unique values