From: Phrogz Date: 2007-12-08T06:45:21+09:00 Subject: Re: Word Loop (#149) On Dec 7, 2:27 pm, Phrogz wrote: > On Dec 7, 1:45 pm, Ruby Quiz wrote: > > > > > Given a single word as input try to find a repeated letter inside of it such > > that you can loop the text around and reuse that letter. For example: > > > $ ruby word_loop.rb Mississippi > > i > > p > > p > > Mis > > ss > > si > > > or: > > > $ ruby word_loop.rb Markham > > Ma > > ar > > hk > > > or: > > > $ ruby word_loop.rb yummy > > yu > > mm > > Maybe it's because it's a Friday afternoon, but I don't understand the > quiz problem. Could someone who understands this try explaining it > (without, of course, discussing any code or even pseudo-code to > approach it). > > I've looked over those examples a few times and I'm totally baffled. > What does "loop the text around and reuse that letter" mean? Ah, got it. [y] -> [u] ^ | | v [m] <- [m] [M] -> [a] ^ | | v [a] [r] ^ | | v [h] <- [k] [i] ^ | [p] ^ | [p] ^ | [M] -> [i] -> [s] ^ | | v [s] [s] ^ | | v [s] <- [i]