Sparse Matrix DP approach to find LCA of two nodes
var MAXN = 100000 ; var level = 18 ; var tree = Array . from ( Array ( MAXN ) , ( ) => Array ( ) ) ; var depth = Array ( MAXN ) . fill ( 0 ) ; var parent = Array . from ( Array ( MAXN ) , ( ) => Array ( level ) . fill ( - 1 ) ) ;