pub fn diameter_of_binary_tree(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
        let mut max_diameter = 0;
        Solution::check_level(root, &mut max_diameter);
        max_diameter
    }
// So each node needs to calculate whether its own diameter is the longest
// when calculating depth.
So each node needs to calculate whether its own diameter is the longest
when calculating depth.
So each node needs to calculate whether its own diameter is the longest when calculating depth .
pub fn diameter_of_binary_tree(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
        let mut max_diameter = 0;
        Solution::check_level(root, &mut max_diameter);
        max_diameter
    }
pub fn diameter_of_binary_tree ( root : Option < Rc < RefCell < TreeNode > > > ) -> i32 { let mut max_diameter = 0 ; Solution :: check_level ( root , & mut max_diameter ) ; max_diameter }
So each node needs to calculate whether its own diameter is the longest
when calculating depth.
So each node needs to calculate whether its own diameter is the longest when calculating depth .
root
Option<Rc<RefCell<TreeNode>>>
root
Option<Rc<RefCell<TreeNode>>>