Returns the longest repeating non - overlapping substring in str
function longestRepeatedSubstring ( str ) { let n = str . length ; let LCSRe = new Array ( n + 1 ) ; for ( let i = 0 ; i < n + 1 ; i ++ ) { LCSRe [ i ] = new Array ( n + 1 ) ; } for ( let i = 0 ; i < n + 1 ; i ++ ) { for ( let j = 0 ; j < n + 1 ; j ++ ) { LCSRe [ i ] [ j ] = 0 ; } }