We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Please update the problem statement to be more descriptive.
At this stage, it is not clear as to what this statement means :
"a tree with N nodes"
1. is it a tree with total number of nodes = n ?
2. is it a tree with height = n ?
3. is it a tree with number of child nodes of each node = n ?
,
and this: "path from u to v", and "edges of the tree"
My Algorithm is working for calculating the correct path but what needs to be done for the overhead of taking modulo. For now I am just printing the result with modulo 10^9+7. What extra needs to be done...
Thankyou.
No more comments
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
C++ solution
for complete solution in python java c++ and c programming search for programs.programmingoneonone.com on google
Please update the problem statement to be more descriptive. At this stage, it is not clear as to what this statement means : "a tree with N nodes" 1. is it a tree with total number of nodes = n ? 2. is it a tree with height = n ? 3. is it a tree with number of child nodes of each node = n ? , and this: "path from u to v", and "edges of the tree"
i can really understand the what does n specifies?Really need help?
My Algorithm is working for calculating the correct path but what needs to be done for the overhead of taking modulo. For now I am just printing the result with modulo 10^9+7. What extra needs to be done... Thankyou.