Calculate tree node changes

Saw an interesting interview questions from DoorDash at Leetcode's forum: "At DoorDash, menus are updated daily even hourly to keep them up-to-date. Each menu can be regarded as a tree. A menu can have many categories; each category can have many menu_items; each menu_item can have many item_…