Maximum Independent Set in a Tree

Given an undirected graph representing a relationship network that forms a tree, write a program to find the maximum number of people that can be chosen such that none of them are directly acquainted ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: