Loading problem...
A social intelligence platform stores directed follow edges and needs to identify the strongest audience-overlap relationships between creators.
Table: Relations
Data guarantees:
Task: For every ordered-free pair of distinct creators, count how many followers they have in common. Return all creator pairs tied for the largest shared-follower count.
Output requirements:
Supported submission environments:
Relations:
| user_id | follower_id |
|---------|-------------|
| 1 | 3 |
| 2 | 3 |
| 7 | 3 |
| 1 | 4 |
| 2 | 4 |
| 7 | 4 |
| 1 | 5 |
| 2 | 6 |
| 7 | 5 |[
{"user1_id":1,"user2_id":7}
]Pair (1, 7) shares followers {3,4,5} (count 3), while (1,2) and (2,7) each share only {3,4} (count 2).
Relations:
| user_id | follower_id |
|---------|-------------|
| 10 | 100 |
| 20 | 100 |
| 10 | 101 |
| 20 | 101 |
| 30 | 102 |
| 40 | 102 |
| 30 | 103 |
| 40 | 103 |[
{"user1_id":10,"user2_id":20},
{"user1_id":30,"user2_id":40}
]Both pairs have a shared-follower count of 2, which is the global maximum, so both must be returned.
Relations:
| user_id | follower_id |
|---------|-------------|
| 1 | 1000 |
| 2 | 2000 |
| 3 | 3000 |[]No follower appears under two different users, so no user pair has a positive common-follower count.
Constraints