← Questions
Filter an n-ary tree by substring and render it indented
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Each node of an n-ary tree has a string value and a list of children.
- Given a search string, return the filtered tree: keep every node whose value contains the substring, plus the ancestors needed to reach it; drop everything else.
- Render the (filtered) tree in a UI with indentation by depth, and update it as the user types in a filter box.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
