← MakeMyTrip questions
CodingReported in a candidate post, Aug 2019

Count special nodes in subtree by color

Filed under MakeMyTrip

Given a tree with colored nodes and a series of queries to mark nodes in a subtree with the same color as special, output the number of special nodes in the subtree for each query.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related MakeMyTrip questions

Collected from public candidate posts and coding forums. Updated Nov 2026.