You are viewing a single comment's thread. Return to all comments →
This line should be added in the description very clearly
To me it seems like such a solution would scale worse than the method using DFS traversal and checking the number of nodes in the subtree?
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Even Tree
You are viewing a single comment's thread. Return to all comments →
Cut each edge and check if the resulting subtree is even in length
This line should be added in the description very clearly
To me it seems like such a solution would scale worse than the method using DFS traversal and checking the number of nodes in the subtree?