-- http://www.codewars.com/kata/52756e5ad454534f220001ef
module LongestCommonSubsequence where

import Data.List
import Data.Ord

lcs :: String -> String -> String
lcs x y = maximumBy (comparing length) (subsequences x `intersect` subsequences y)