Function to calculate the character count for each path from node i to 1 ( root node )
function buildTree ( i ) { for ( let l = 0 ; l < tree [ i ] . length ; l ++ ) { let nextNode = tree [ i ] [ l ] ; for ( let j = 0 ; j < MAX_CHAR ; j ++ ) {