While the story is somewhat chiling, I also wonder exactly how the professor approached the programming part of this. I'm very much doubting he used perl... :-)
Given two English text strings, $a and $b, and two integers $m and $n, 0 < $m <= $n. Both $a and $b have been stripped of punctuation and converted to lower case, leaving all characters as either ('a'..'z') or the space ' '.
Find the perl golf solution (fewest # of characters in code) that returns a list of phrases with at least $m but no more than $n words that are in both $a and $b.
update changed "$m < $n" to "$m <= $n"; shouldn't affect the golf solution, but makes sense if you want to find repeated phrases of only one size. Eg, if $m=$n=1, you could find all single words in common with both strings.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
2001-05-10 Edit by Corion: Fixed title
|
---|
Replies are listed 'Best First'. | |
---|---|
Re (tilly) 1: Golf (Inspired): Repeated Phrases
by tilly (Archbishop) on May 10, 2001 at 17:34 UTC | |
by Masem (Monsignor) on May 10, 2001 at 17:56 UTC | |
Re: Golf (Inspired): Repeated Phrases
by chipmunk (Parson) on May 10, 2001 at 19:51 UTC | |
by MeowChow (Vicar) on May 10, 2001 at 20:40 UTC | |
Re: Golf (Inspired): Repeated Phrases
by chipmunk (Parson) on May 10, 2001 at 21:01 UTC | |
Re: Golf (Inspired): Repeated Phrases
by Corion (Patriarch) on May 10, 2001 at 20:05 UTC |