Amazon Interview Question

TopK Frequent elements, Maximum path sum in a tree