Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hopefully my code won't take longer than 24 hours to run (against the 2of12inf.txt). I too find these results odd. If I haven't any logic bugs or fence post errors, my code will put any doubt to rest though I suspect you will figure it out before my code finishes ;-)

Update: My code only took 12 minutes and it disagrees with your results. I manually checked and I think you must have a bug somewhere. Your winning solution (aeilprst: 552) really only gets 344. I even included duplicates (if there were any) to try and account for the delta but came up empty handed. See below:

#!/usr/bin/perl use strict; use warnings; my %winner = map {$_ => undef} qw/a e i l p r s t/; open(my $fh, '<', '2of12inf.txt') or die "Unable to open '2of12inf.txt +' for reading: $!\n"; WORD: while (<$fh>) { chomp; $_ = lc($_); tr/a-z//cd; next if ! $_ || length($_) > 8; my %word; ++$word{$_} for split //; for my $l (keys %word) { next WORD if ! exists $winner{$l} || $word{$l} > 1; } print "$_\n"; } __END__ ail ails air airs aisle ale alert alerts ales alit alp alps alter alters ape apes apse apt apter are ares arise art arts as asp aspire aster astir at ate ear earl earls ears east eat eats era eras erst esprit eta etas ilea irate ire ires is isle islet it its la lair lairs lap laps lapse las laser last late later lea leap leaps leapt leas least lei leis lept lepta lest let lets liar liars lie lies lip lips lira liras lire lisp lisper list lit lite liter liters litre litres pa pail pails pair pairs pal pale paler pales palest pals par pare pares pars parse part parties parts pas past paste pastel pastier pat pate pates pats pea peal peals pear pearl pearls pears peas peat peats pelt pelts per peril perils pert pest pet petal petals pets pi piaster piastre pie pier piers pies pilaster pile piles pirate pirates pis pit pita pitas pits plait plaits plaster plat plate plates platies plats plea pleas pleat pleats pliers plies praise prate prates pries priest prise psi rail rails raise rap rape rapes rapist raps rapt rasp rat rate rates rats re real realist reap reaps relit rep repast reps res rest retail retails rial rials rile riles rip ripe ripest rips rise rite rites sail sale salt salter saltier sap sari sat sate satire sea seal sear seat sepal sepia septa sera serial set silt sip sir sire sit sitar site slap slat slate slept slier slip slit spa spar spare spat spate spear spelt spiel spilt spiral spire spirea spit spite splat split sprat sprite stair stale staler staple stapler star stare steal step stile stir strap strep stria striae strip stripe tail tails tale tales tali tap tape taper tapers tapes tapir tapirs taps tar tare tares tarp tarps tars tarsi tea teal teals tear tears teas ti tie tier tiers ties tile tiler tilers tiles tip tips tire tires tis trail trails traipse trap traps trial trials tries trip tripe tripes triple triples trips tsar

Cheers - L~R

In reply to Re^4: Challenge: 8 Letters, Most Words (top 50) by Limbic~Region
in thread Challenge: 8 Letters, Most Words by Limbic~Region

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (2)
    As of 2018-04-21 05:48 GMT
    Find Nodes?
      Voting Booth?