You are given the root of a binary tree, root. Return the sum of the values of its deepest nodes.
The deepest nodes are the nodes at the maximum depth in the tree, where the root has depth 0. There can be more than one node at the maximum depth, and all of them are included in the sum.
Your function receives root as a TreeNode. The node type is provided for you, with val, left, and right fields.
The examples below write the tree as its level-order traversal, where null marks a missing child of a listed node and trailing nulls are omitted. That is only how the input is displayed; the decoding is done for you.
root is in the range [1,105].Node.val ≤104