Company: Barclays
Difficulty: medium
Maximum Toll Revenue Road CPP GCC 5.5.0 Note: We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted, you cannot review this problem again. You can use cout to debug your code. The cout may not work in case of syntax/runtime error. In a state, N cities with unique city codes from 1 to N are connected by N-1 roads. The road network is in the form of a tree, where each road connects two cities. A path is a road or a combination of roads connecting any two cities. Each road has a toll booth that collects a toll equal to the maximum number of paths of which that particular road is part. The state transportation authority wants to identify the road on which the maximum toll revenue is collected. Write an algorithm to help the transportation authority identify the pair of cities connected by the road on which the maximum toll revenue is collected. The output should be sorted in increasing order. If more than one road collects the same to