in reply to Re^3: Challenge: 8 Letters, Most Words
in thread Challenge: 8 Letters, Most Words
I think all you need to do is to sort the words descending by length before you run through your loop. See my variation below which is very similar to yours Re^2: Challenge: 8 Letters, Most Words.
The reason is that a longer word will never be added to the stack of a shorter word, so you do not need to check that.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Challenge: 8 Letters, Most Words
by aaron_baugher (Curate) on Oct 05, 2013 at 15:38 UTC | |
by hdb (Monsignor) on Oct 05, 2013 at 17:43 UTC |
In Section
Seekers of Perl Wisdom