fork(2) download
  1. module Main where
  2.  
  3. import Data.List
  4. import System.Exit
  5.  
  6.  
  7. al1 xs = nub . concat . map (drop 1 . inits) . tails $ xs
  8.  
  9. cmp xs xz = [ x | x <- ((al1 xs)++(al1 xz)), notElem x (intersect (al1 xs) (al1 xz) )]
  10.  
  11.  
  12. main = do
  13. line <- getLine
  14. line2 <- getLine
  15. putStr $ show $ length $ cmp line line2
  16. exitWith ExitSuccess
Success #stdin #stdout 0s 5748KB
stdin
qwertyuiop
asderqwpo
stdout
84