Diameter of Binary Tree (LeetCode 543).
Asked in the round 2 stage. Given a binary tree, return the number of edges on the longest path between any two nodes. Represent the tree as nested dictionaries with val, left, and right keys, using null for an absent child.
def diameter_of_binary_tree(root): returns an integer.
def diameter_of_binary_tree(root):