Diameter of Binary Tree
Given the root of a binary tree, return the length of the diameter of the tree.
Diameter of Binary Tree

Given the root of a binary tree, return the length of the diameter of the tree.

Example 1:
Input: {"root":[1,2,3,4,5]}
Output: 3
Input
arr ={"root":[1,2,3,4,5]}
Diameter
0

1

2

3

4

5

Variables
VariableValue
diameter0
DepthFunction Call
Stack empty
0/27