← Accolite questions

Find number of distinct groups from parent-child pairs without building a graph

Filed under Accolite

You are given a 2D array of size N x 2 containing parent-child pairs. Determine the number of disconnected groups (connected components) formed by these relationships directly from the array without…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Accolite questions

Collected from public candidate posts and coding forums. Updated Nov 2026.