Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Find the shortest word in the English Language with: a b c d e f

by mr_mischief (Monsignor)
on Jul 06, 2018 at 00:25 UTC ( #1218008=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $s=99;$c='abcdef';for(<>){chomp;$w=$_;$l=y///c;@m=grep{1+index$w,$_}sp
    +lit//,$c;@m>5&&$s>$l||next;$s=$l;$n=$w}print$n
    
  2. or download this
    $s=9;$c='abcdef';for(<>){chop;$w=$_;$l=y///c;(5<grep{1+index$w,$_}spli
    +t//,$c)&&$s>$l||next;$s=$l;$n=$w}print$n
    
  3. or download this
    $s=9;for(<>){chop;$w=$_;$l=y///c;(5<grep{1+index$w,$_}split//,'abcdef'
    +)&&$s>$l||next;$s=$l;$n=$w}print$n
    
  4. or download this
    $s=9;for(<>){chop;$w=$_;$l=y///c;(5<grep{1+index$w,$_}split//,'abcdef'
    +)&&$s>$l&&do{$s=$l;$n=$w}}print$n
    
  5. or download this
    $s=9;for(<>){$w=$_;$l=y///c;(6<grep{1+index$w,$_}split//,"abcdef\n")&&
    +$s>=$l&&do{$s=$l;$n=$w}}print$n
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2023-10-04 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?