Average of Levels in Binary Tree

Return the average value of nodes on each level in the binary tree. For an empty tree, return an empty array. The average for a level is its node-value sum divided by its node count.

Examples
Input: [3,9,20,null,null,15,7]
Output: [3,14.5,11]
Hints

Average of Levels in Binary Tree

Return the average value of nodes on each level in the binary tree. For an empty tree, return an empty array. The average for a level is its node-value sum divided by its node count.