fork download
  1. main = do
  2. print $ hoge ["abcdef", "abc123"]
  3. print $ hoge ["あいうえお", "あいさんさん", "あいどる"]
  4. print $ hoge ["12345", "67890", "12abc"]
  5.  
  6. f s = all $ (==s) . take (length s)
  7. g = map reverse . scanl (flip (:)) []
  8. h (x:xs) = last $ takeWhile (flip f xs) (g x)
  9. hoge xs = map (drop (length (h xs))) xs
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )
Linking prog ...
stdout
["def","123"]
["\12358\12360\12362","\12373\12435\12373\12435","\12393\12427"]
["12345","67890","12abc"]