Function to find the count of pairs such that the minimum distance between them is equal to the difference between distance of the nodes from root node
void countPairs ( vector < vector < int > > edges ) { for ( int i = 0 ; i < edges . size ( ) ; i ++ ) { int u = edges [ i ] [ 0 ] ; int v = edges [ i ] [ 1 ] ;