You are given an integer array parent representing a rooted tree with parent[i] is the parent of node i. The root of the tree is node parent[0] == nums of length nums[i] represents the value assigned to node i.
The depth of a node is the number of nodes on the path from the root node
Let i with depth
You are given an integer array parent representing a rooted tree with parent[i] is the parent of node i. The root of the tree is node parent[0] == nums of length nums[i] represents the value assigned to node i.
The depth of a node is the number of nodes on the path from the root node
Let i with depth