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.
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]
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 →
I updated your code to current state of affairs (Python 3, current task formulation with variables n adn m, fixed minor errors):