Count Your Cousins

From programming_contest
Revision as of 06:09, 27 August 2016 by imported>Kmk21 (Created page with "The only real challenge here is building the graph. You just have to who you're adding children to. Once you've built the graph, you go up one level and memorize your parent....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The only real challenge here is building the graph. You just have to who you're adding children to. Once you've built the graph, you go up one level and memorize your parent. Then go up another level and iterate through all the children's children (skipping your parent) and count them.