← 返回 citadel 的题目列表Find Pair with Maximum Common Friends or Minimum Indices
类型:online_judge
citadel
Given a list of people's names, find the two people with the maximum number of common friends. Each person has a list of friends. If there's a tie, return the pair with the smallest indices; if no common friends exist, find two who are not friends and return the pair with the smallest indices. The dataset could be large (up to 1000 people, each with up to 1000 friends).
Example
Input
a, b, c
0: [1]
1: [0]
2: []