gr0k,
If you have a requirement to allow duplicates in the combination but no more than is present in the original list then the code is easy enough to change.
@_ == keys %{@_,reverse @_);
That is misleading because it also removes duplicates. The difference is you are using letters instead of numbers so there should never be any duplicate. The change you have made to dereference slows the code back down again.

Again, this is a terrible approach since you are spinning cycles needlessly. If you don't believe me:

Formula for determining number of unique combinations of k values in a set of n letters is n!/k!(n-k)!

That is a total of 63 possible combinations you should be testing, but your misuse of Algorithm::Loops has lead to testing 55,986. Unique combination certainly are not permutations.

L~R

In reply to Re: Re: Re: Re: Re: amount permutations by Limbic~Region
in thread amount permutations by gr0k

Title:
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, details, 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, summary, 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.