• + 0 comments
    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 };
    }