Driver code
let s = " " ; let k = 2 ; let n = s . length ; let l = new Array ( MAX_CHAR ) ; let r = new Array ( MAX_CHAR ) ; for ( let i = 0 ; i < MAX_CHAR ; i ++ ) { l [ i ] = new Array ( MAX ) ; r [ i ] = new Array ( MAX ) ; for ( let j = 0 ; j < MAX ; j ++ ) { l [ i ] [ j ] = 0 ; r [ i ] [ j ] = 0 ; } } precompute ( s , n , l , r ) ; document . write ( countPalindromes ( k , n , l , r ) ) ;