Question Description
You are given a hierarchy of monsters represented as a n-ary tree. Each monster has a unique name, a list of monsters it can defeat, and a hostile status. A monster marked with an asterisk ("*") is considered hostile.
Given a list of monsters and the root monster, return a list of non-hostile monsters that can defeat all hostile monsters in the hierarchy.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Stdout
-