Construct Binary Tree from Parent-Child Pairs and Return S-Expression

Problem: Construct a Binary Tree from Parent-Child Pairs and Return an S-Expression

You are given a string containing multiple parent-child pairs. Each pair has the format:

(P,C)

whe...

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: