Sort 58 Discussions, By:
Please Login in order to post a comment
If you need a hint,
Observe how the parent array changes when children of the root becomes the root.
the input parser has a bug for c++14: the guesses count in the loop
IMHO, this challenge should be rated Expert, or at least Hard.
Bear in mind the input may contain duplicate guesses for a node. This threw me out for a week when I unintentionally removed support for duplicate guesses while trying to optimise.