Search
⌘K

Leetcode 3058. Friends With No Mutual Friends

Given an undirected friendship graph (list of friend pairs), identify/count the friend pairs that share no mutual friends — i.e., their neighbor sets are disjoint. The core challenge is efficiently testing zero intersection of adjacency sets for many pairs (scale with large n/m), typically requiring set/bitset optimization or hashing to avoid O(deg^2) checks.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.