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.
I found some people are playing with the example input and come up with super short simple soultion. They play math with the value of the vertexes, and take adavatage of some rules in the examples.
I feel that is not correct, though they were able to pass all tests.
Here are some questions I think need to clarify:
Is this a tree (has root) or a graph (no root)?
I assume no root, or any node can be consdier as a root.
Is this directed graph or underected?
I assum underected.
Are we supposed to remove any edge or just the edge connect to root?
Since I assume no root, I assume we can remore any edge
Is it guranteed the value of vertexes are 1,2,3,4,5..and sof forth?
Some solutions on interet are simply doing calculation with these values. But I assume they can be any value, not even intergers. I assume using interger in the diagram is just for the sake of easy to read.
Are my assumption correct?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Even Tree
You are viewing a single comment's thread. Return to all comments →
I found some people are playing with the example input and come up with super short simple soultion. They play math with the value of the vertexes, and take adavatage of some rules in the examples. I feel that is not correct, though they were able to pass all tests.
Here are some questions I think need to clarify:
Is this a tree (has root) or a graph (no root)? I assume no root, or any node can be consdier as a root.
Is this directed graph or underected? I assum underected.
Are we supposed to remove any edge or just the edge connect to root? Since I assume no root, I assume we can remore any edge
Is it guranteed the value of vertexes are 1,2,3,4,5..and sof forth? Some solutions on interet are simply doing calculation with these values. But I assume they can be any value, not even intergers. I assume using interger in the diagram is just for the sake of easy to read.
Are my assumption correct?