Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 344 Bytes

README.md

File metadata and controls

11 lines (9 loc) · 344 Bytes

This problem was asked by Apple.

Given the root of a binary tree, find the most frequent subtree sum. The subtree sum of a node is the sum of all values under a node, including the node itself.

For example, given the following tree:

  5
 / \
2  -5

Return 2 as it occurs twice: once as the left leaf, and once as the sum of 2 + 5 - 5.