On Jan 18, 2008, at 9:49 AM, Denis Hennessy wrote: > On 18 Jan 2008, at 13:23, Ruby Quiz wrote: >> This week's Ruby Quiz is to write a script that finds the longest >> repeated >> substring in a given text. >> >> Your program will be passed some text on STDIN and is expected to >> print the >> longest repeated substring within that text to STDOUT. >> >> Repeated substrings may not overlap. If more than one substring is >> repeated >> with the same length, you may print any of them. If there is no >> repeated >> substring, the result is an empty string (print nothing). >> >> Example: >> >> $ echo banana | ruby longest_repeated_substring.rb >> an >> >> OR >> >> $ echo banana | ruby longest_repeated_substring.rb >> na >> >> Make sure your code runs efficiently when passed a large text. >> > > Should white space and punctuation be treated as part of the > substring, or are they to be ignored? I vote that we treat all characters equally. James Edward Gray II