Function that returns the max distance between the nodes that have the same key
function computeDistance ( root , value ) { if ( root == null ) { return - 1 ; } let left = computeDistance ( root . left , value ) ; let right = computeDistance ( root . right , value ) ;