Narcissistic decimal number: Difference between revisions
m
→Haskell – Reduced search (unordered digit combinations)
(→{{header|Haskell}}: Faster version (search space reduced from integer series to unordered digit combinations)) |
|||
Line 1,078:
===Reduced search (unordered digit combinations)===
As summing the nth power of the digits is unaffected by digit order, we can reduce the search space by filtering
<lang haskell>import Data.List (sort)
|