Algorithm · Karat · Medium
A pair of friends is trying to pick a restaurant to go to together. They want somewhere new: the restaurant must not already be liked by either of the two. Among such options, they prefer the one that is liked by the largest number of people who are friends with both of them. You are given a list of friendship pairs and, for each person, the set of restaurants that person likes. Return a restaurant that satisfies these conditions, or None if no such restaurant exists.…