If leaf node reached , increment count of path length of this root to leaf path .
if ( node . left == None and node . right == None ) : NEW_LINE INDENT if path_len [ 0 ] not in m : NEW_LINE INDENT m [ path_len [ 0 ] ] = 0 NEW_LINE DEDENT m [ path_len [ 0 ] ] += 1 NEW_LINE return NEW_LINE DEDENT