Whatnot interview question

Q: Graph question, leetcode easies