fork download
  1. import Data.List
  2.  
  3. main = print $ solve
  4.  
  5. solve = length $ filter test $ permutations [0..9]
  6.  
  7. test [a, b, c, d, e, f, g, h, i, j] =
  8. a * (b * 10 + c) + (d * 100 + e * 10 + f) == g * 1000 + h * 100 + i * 10 + j
  9.  
Success #stdin #stdout 1.69s 7248KB
stdin
Standard input is empty
stdout
350