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.
1) This problem has no dependence on which node you choose to be the root. The answer will always be the same assuming there are no edges that result in ties.
2) The edges are undirected, which means you should assume they are bidirectional. Thus the ordering of the vertex pairs should not affect your implementation.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cut the Tree
You are viewing a single comment's thread. Return to all comments →
1) This problem has no dependence on which node you choose to be the root. The answer will always be the same assuming there are no edges that result in ties.
2) The edges are undirected, which means you should assume they are bidirectional. Thus the ordering of the vertex pairs should not affect your implementation.