A function to answer queries of longest common extension
function LCEQueries ( str , n , q , m ) { for ( let i = 0 ; i < m ; i ++ ) { let L = q [ i ] . L ; let R = q [ i ] . R ; document . write ( " " + L + " " + R + " " + LCE ( str , n , L , R ) + " " ) ; } return ; }