You are viewing a single comment's thread. Return to all comments →
I agree. I think building a tree from the input stream, combined with the wording of the question really adds to the complexity of this rather basic problem.
Should be a "Moderate".
solve it for fun why runnning behind "rating" unless you solving it in live competition. Just sayin!
First of all, building a tree is trivial. And second, you don't need to build a tree to solve this. :-)