LeetCode 1729: Find Followers Count
Problem Description
Explanation:
To solve this problem, we need to count the number of followers for each user. We can achieve this by grouping the followers by user_id and then counting the number of followers for each user. We can use a GROUP BY query to group the followers by user_id and then use COUNT function to count the number of followers for each user.
Solutions
# Write your Java solution here
SELECT user_id, COUNT(follower_id) AS followers_count
FROM Followers
GROUP BY user_id
ORDER BY user_id;
Loading editor...