hello guys , so i was trying to solve a question and came up with this one.
Given a tree with N nodes , you need to find the number of Pth cousins . where a Pth cousin is defined as a pair of nodes x,y and there exists a node z which is Pth ancestor of both x and y . you need to print an array of n integers each denoting the count of ith cousins , where 1<=i<=n .
1<n<=100000