• + 1 comment

    I updated your code to current state of affairs (Python 3, current task formulation with variables n adn m, fixed minor errors):

    N_guys = n
    guys_lst = topic
    
    pairs_max_top = [bin(int(guys_lst[i],2) | int(guys_lst[j],2)).count('1') for i in range(N_guys-1) for j in range(i+1,N_guys) ]
    max_top=max(pairs_max_top) 
    max_team_num=pairs_max_top.count(max_top)
    
    return [max_top,max_team_num]