We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static List<int> acmTeam(List<string> topic)
{
int m = topic.Count; // member count
int t = topic[0].Length; // topic count
List<int> teams = new(); // team known topic counts
for(int i=0; i < m-1; i++)
{
for(int j=i+1; j < m; j++)
{
int known = 0;
for(int k=0; k < t; k++)
{
if(topic[i][k]=='1' || topic[j][k]=='1')
{
known++;
continue;
}
}
teams.Add(known);
}
}
int max = teams.Max();
int count = teams.Count(t=> t==max);
return new List<int>{ max, count };
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →