amazon
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-01-10Added By Anonymous
Source: Link
I had amazon phone intrview and this my questions similar to leetcode Number of Connected Components in an Undirected Graph
int[][] edges = {{0, 1}, {0, 2}, {1, 2}, {1, 3}, {3, 4},{5,6},{6,7},{8,5},{10,null}};
out put n1={0,1,2,3,4} , n2 {5,6,7,8}, n3 {10}