Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Block Search

by BrowserUk (Pope)
on Oct 04, 2002 at 21:34 UTC ( #202911=note: print w/replies, xml ) Need Help??


in reply to Block Search

$_='abbbcddddfegrgrgddeeeeedd'; print+(@b=sort{(()=$b=~/./g)<=>(()=$a=~/./g)}/((.)\2+)/cg)[0] #62

Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

Replies are listed 'Best First'.
Re2: Block Search
by blakem (Monsignor) on Oct 04, 2002 at 21:55 UTC
    If you just want to find the longest sequence, a few tweaks will bring it down to.... 47 chars
    # 1 2 3 4 #2345678901234567890123456789012345678901234567 print+(sort{$b=~y///c-$a=~y///c}/((.)\2*)/g)[0]

    -Blake

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://202911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2019-09-21 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (272 votes). Check out past polls.

    Notices?