http://www.perlmonks.org?node_id=1041138


in reply to Analysing a (binary) string. (Solved)

Hi, BrowserUk

If i understand it right, ! Since we dont know the length of the sub string that might repeat. It can be of length from 1-N/2. So if we start from 1 we need to parse the whole array N and for length 2 - (N-1) for length 3 - (N-2). So the time complexity of any algorithm for this problem would be "~N factorial". So if the string length is > 100 then it might take hours to get the complete solution !!