Given a binary tree, check if it's uni-value tree. A Uni-value tree means all nodes of the tree have the same value.
For example: Given binary tree,
5 / \ 5 5 / \ \ 5 5 5
Please check the main.js snippet for the solution.
If you have different approach in mind or have any suggestion for this implementation feel free to share in the comment below. Thanks!