โ† Amazon questions

Count distinct clusters of ones in a graph

Filed under Amazon

Given an undirected graph or grid represented by vertices with values 0 or 1, find the number of distinct connected components (clusters) formed exclusively by vertices with value 1.

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 Amazon questions

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