Driver Code
let S = " " ; let len = S . length ; let mat = new Array ( MAX ) ; for ( let i = 0 ; i < MAX ; i ++ ) { mat [ i ] = new Array ( CHAR_SIZE ) ; for ( let j = 0 ; j < CHAR_SIZE ; j ++ ) { mat [ i ] [ j ] = 0 ; } } precompute ( mat , S , len ) ; let get = query ( mat , " " , len ) ? " " : " " ; document . write ( get + " " ) ; get = query ( mat , " " , len ) ? " " : " " ; document . write ( get + " " ) ; get = query ( mat , " " , len ) ? " " : " " ; document . write ( get + " " ) ; get = query ( mat , " " , len ) ? " " : " " ; document . write ( get + " " ) ;