Back to problems

Friend Recommendation System

Algorithm · Meta · Medium

Friend Recommendation System Build a friend suggestion routine for a social network. The network has n users numbered 0 through n - 1. You are given a list of undirected friendships (u, v), a specific user target, and an integer k giving how many suggestions to return. Suggestions follow these rules: A suggested user must not be target and must not already be a friend of target. Each candidate is scored by how many friends it has in common with target (its mutual friends).…

Loading the rest of the question…