</>OfferRetriever
DashboardDiscuss
NEW
Halloween SalePremium questions, over 30% offUnlock all premium questions for over 30% off
$10.42$7.08/mo

--

:

--

:

--

:

--

Get this deal
Back to Snapchat Questions

Unfriended Pairs Counter

Medium
FREE

In a social network of n people labeled 0 to n - 1, friendship is mutual and transitive through direct connections. People belong to the same friend group (connected component) when a chain of direct friendships links them.

Given a list of direct connections (pairs [a, b]), count the number of unordered pairs (i, j) where 0 <= i < j < n such that i and j are not in the same friend group. ...

Asked at:Snapchat

More Snapchat interview questions

All Snapchat interview questions
OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCodeCompare
LEGAL

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.