TikTok Interview Question

Paths sum of a tree.