Company: Barclays
Difficulty: medium
Family Phone Tree C++14 Every member of a family owns at least one mobile phone. The head of the family keeps track of all the phone accounts. She has sketched out a tree figure wherein each node of the tree represents a member of the family and the value of the node represents the number of phones owned by that person. The head of the family assigns herself to be the root of this tree. She wishes to find the maximum number of phones owned by any single generation of family members. She wishes to find which generation of the family owns the most phones. [All the members who belong to the same level of the tree are considered as belonging to the same generation.] Write an algorithm to find the maximum number of phones owned by a single generation of family members. Input Format First line: Integer num , representing the total number of family members (N) Second line: N space-separated integers arr 1 , arr 2 , ..., arr N , representing the number of phones owned by each family member Thi