fork(1) download
  1. import Data.List
  2.  
  3. p(s)=if any(\x->reverse x==x)$permutations s then"YES"else"NO"
  4.  
  5. main =
  6. print $ map p [
  7. "aab",
  8. "abc",
  9. "racecar",
  10. "aaa"
  11. ]
  12.  
Success #stdin #stdout 0.01s 5392KB
stdin
Standard input is empty
stdout
["YES","NO","YES","YES"]