Given the root of a binary tree, return the values of its boundary in order.
The boundary is formed by concatenating the following four parts:
root node itself (the root is never considered a leaf in this problem).
Note: A leaf node is any node with no left or right child. The root is never treated as a leaf for this problem. The leftmost and rightmost leaves are not included in the left or right boundaries respectively, only in the leaves section.
Constraints:
number of nodes
Node.val
Given the root of a binary tree, return the values of its boundary in order.
The boundary is formed by concatenating the following four parts:
root node itself (the root is never considered a leaf in this problem).
Note: A leaf node is any node with no left or right child. The root is never treated as a leaf for this problem. The leftmost and rightmost leaves are not included in the left or right boundaries respectively, only in the leaves section.
Constraints:
number of nodes
Node.val