Skip to content

Practice Find Followers Count

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#1729
LeetCode Problem

Find Followers Count

Problem Statement

Tables: Followers(user_id INT, follower_id INT). Followers has key (user_id, follower_id); follower_id follows user_id. Return user_id and followers_count for users represented in Followers. Count followers for each user and order by user_id ascending.

Source: Find Followers Count on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
Followers table: +---------+-------------+ | user_id | follower_id | +---------+-------------+ | 0       | 1           | | 1       | 0           | | 2       | 0           | | 2       | 1           | +---------+-------------+
Output
+---------+----------------+ | user_id | followers_count| +---------+----------------+ | 0       | 1              | | 1       | 1              | | 2       | 2              | +---------+----------------+

Related LeetCode Problems

Practice more problems similar to Find Followers Count.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.