Welcome to the Python screen.
The question is on your right: Print Meta View Hierarchy. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
In a Meta mobile app such as Facebook or Instagram, UI debugging often requires inspecting the full view tree from a root view. Given the root of a view hierarchy, return a formatted list of strings representing the entire hierarchy in top-down order, with indentation showing parent-child relationships.
Each view has a name string and a list of children. Write a function that traverses the hierarchy and returns one string per view. The root should have no indentation, its children should be prefixed with two spaces, grandchildren with four spaces, and so on.
root, a view node object or Nonename: stringchildren: list of child view nodesdef print_view_hierarchy(root):