Find the missing permutation: Difference between revisions
→{{header|Haskell}}: Dropped one redundant import, narrowed the others. Dropped a redundant 'do', applied hindent.
No edit summary |
(→{{header|Haskell}}: Dropped one redundant import, narrowed the others. Dropped a redundant 'do', applied hindent.) |
||
Line 990:
=={{header|Haskell}}==
{{works with|GHC|
<lang haskell>import Data.List ((\\), permutations, nub)
import Control.Monad (join)
missingPerm
:: Eq a
=> [[a]] -> [[a]]
missingPerm = (\\) =<< permutations . nub . join
deficientPermsList
deficientPermsList =
[ "ABCD"
, "CABD"
, "ACDB"
, "DACB"
, "BCDA"
, "ACBD"
, "ADCB"
, "CDAB"
, "DABC"
, "BCAD"
, "CADB"
, "CDBA"
, "CBAD"
, "ABDC"
, "ADBC"
, "BDCA"
, "DCBA"
, "BACD"
, "BADC"
, "BDAC"
, "CBDA"
, "DBCA"
, "DCAB"
]
main
main
{{
=={{header|Icon}} and {{header|Unicon}}==
|