A component tree passes a prop downward. Tree JSON: {"name": string, "receivesProp": boolean, "children": [...]}. Print the names of all components that receive the prop, depth-first, comma-separated (or none).
Input: one tree JSON.
Output: comma-separated names or none.
Your program reads from stdin and prints to stdout.
Example 1
Input: {"name":"App","receivesProp":true,"children":[{"name":"Header","receivesProp":false,"children":[]},{"name":"Body","receivesProp":true,"children":[{"name":"Item","receivesProp":true,"children":[]}]}]}
Output: App,Body,Item
Hints
A component tree passes a prop downward. Tree JSON: {"name": string, "receivesProp": boolean, "children": [...]}. Print the names of all components that receive the prop, depth-first, comma-separated (or none).
Input: one tree JSON.
Output: comma-separated names or none.
Your program reads from stdin and prints to stdout.
Example 1
Input: {"name":"App","receivesProp":true,"children":[{"name":"Header","receivesProp":false,"children":[]},{"name":"Body","receivesProp":true,"children":[{"name":"Item","receivesProp":true,"children":[]}]}]}
Output: App,Body,Item
Hints