A grove in Codetikki is a binary tree where each node carries a value. The shamans want to find which level of the grove has the smallest total sum. Given a binary tree, return the level (0-indexed) that has the minimum sum. If multiple levels tie, return the smallest level. Input: tree in level-order with "null" for absent nodes. Output: the level number with minimum sum.
Example 1:
Example 2:
Constraints:
1 <= number of nodes <= 10^4 -10^4 <= node value <= 10^4
Tags:
