Ads Click and Impression Tree Statistics

Design an ad hierarchy: a Campaign can contain AdGroups and Ads, and an AdGroup can contain Ads (a tree whose leaves are Ads). Implement three operations:

  1. AddAdEntity(nodeId, parentId): register...

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: