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
static void countPairs ( int [ ] [ ] edges ) { for ( int i = 0 ; i < edges . length ; i ++ ) { int u = edges [ i ] [ 0 ] ; int v = edges [ i ] [ 1 ] ;