← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given an unrooted tree with n nodes (n ≤ 2·10^5), find the size of a maximum independent set — the largest subset of nodes such that no two are adjacent. The tree is given as an undirected graph with n-1 edges. Return the cardinality of this largest independent set.