Delete a Node from a Forest Represented by Parent Index Array

Problem: Delete a Node from a Forest Represented by a Parent Index Array

You are given an array parent of length n, representing a forest. Nodes are indexed from 0 to n - 1.

  1. `parent[i]...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: