#K45132. Largest Common Topic Group
Largest Common Topic Group
Largest Common Topic Group
You are given a list of participants along with the topics they are interested in. Each participant's information starts with their name followed by one or more topics separated by spaces. Your task is to determine the largest group of participants that share at least one common topic. Formally, if participants have topics T1, T2, ..., Tk, you must compute the maximum frequency of any topic among all participants.
Note: The input is read from standard input and the output is printed to standard output.
inputFormat
The first line of input contains an integer N, representing the number of participants. This is followed by N lines, each containing a participant's name and one or more topics separated by spaces.
outputFormat
Output a single integer representing the maximum number of participants that share at least one common topic.## sample
6
Alice AI Data-Science
Bob AI Machine-Learning
Charlie Cybersecurity
David Data-Science Machine-Learning
Eve AI Data-Science
Frank Cybersecurity
3