So, lots of calculations…
Some permutations are identical so you can optimise those away
If any of the digits are repeated, some permutations will be identical
1234 has 24 permutations
1231 also has 24 permutations, but some of them are identical, so there are really only 12
It doesn't
Because permutations and combinations are different things.
This script runs it through 768 different eval() calls:
The strings for those eval() calls were in turn generated by this script:
To create this library of possible combinations:
Nothing!
It's just a better user experience if you feel like the website is really working hard finding your answer…
/