Longest common suffix: Difference between revisions

m
→‎{{header|Haskell}}: Reduced slightly with foldr
(→‎{{header|Python}}: Added a draft in Python)
m (→‎{{header|Haskell}}: Reduced slightly with foldr)
Line 220:
longestCommonSuffix :: [String] -> String
longestCommonSuffix =
foldr (flip (<>) . return . head) [] .
reverse .
head . transpose . takeWhile (all =<< (==) . head) . transpose . fmap reverse
 
main :: IO ()
9,655

edits