Store all nodes of same line together as a vector
Vector < Integer > k = diagonalPrint . get ( d ) ; if ( k == null ) { k = new Vector < > ( ) ; k . add ( root . data ) ; } else { k . add ( root . data ) ; } diagonalPrint . put ( d , k ) ;