Group Loans by Ultimate Parent Company

Given company hierarchy records and loan records, group every loan by its ultimate parent company.

Each company has at most one direct parent. For the company associated with a loan, repeatedly f...

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: