Print Comments Hierarchically by Parent-Child Relationship

Given a set of comments, each with a comment ID and a parent ID, your task is to print out these comments in a hierarchical structure by parent-child relationship. Requirements:

  • Input is a set of c...

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: