Algorithm · Reddit · Medium
You have two data structures that capture follower relationships across a social platform: communityToFollowers: a 2D list where the element at index i holds the list of follower IDs (strings like "F0", "F1", etc.) who follow community C_i. followerToCommunities: a 2D list where the element at index j holds the list of community IDs (strings like "C0", "C1", etc.) that are followed by follower F_j. Design a function that receives an integer communityIdx and returns all…
Checking your access…