602. Friend Requests II: Who Has the Most Friends
Table:
Write a solution to find the people who have the most friends and the most friends number.
The test cases are generated so that only one person has the most friends.
The result format is in the following example.
Example 1:
In this case, we need to count all the occurrences of all id(s) in both columns - requester_id as well as accepter_id and group them together.
This counts all the occurrences in requester_id.
This counts in all accepter_id.
Now, if we union all them, we will preserve the duplicates as it is unlike union.
Now to get the one with most friends, lets do limit 1.