Anonymous - 2007-10-31 23:31:29
Don’t know what happened before. Again, but with the missing new line:
pairs l = [(x,y) | (x:r) <- tails l, y <- r] statePairs = map (\(x,y) -> (sort (x ++ y),(x,y))) $ pairs states answer = filter (\((x,),(y,)) -> x == y) $ pairs statePairs
formatting is with Textile syntax. Comments are not displayed until they are approved by a moderator. Moderators will not approve unless the comment contributes value to the discussion.
Anonymous - 2007-10-31 23:31:29
Don’t know what happened before. Again, but with the missing new line:
pairs l = [(x,y) | (x:r) <- tails l, y <- r] statePairs = map (\(x,y) -> (sort (x ++ y),(x,y))) $ pairs states
answer = filter (\((x,),(y,)) -> x == y) $ pairs statePairs