Starting the cut from ith character taking temporary node pointer for checking whether the subString [ i , j ) is present in trie of not
let temp = root ; for ( let j = i + 1 ; j <= n1 ; j ++ ) { if ( temp . child [ S1 [ j - 1 ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ] == null )