Skip to content

Instantly share code, notes, and snippets.

@bltavares
Created June 13, 2012 23:17
Show Gist options
  • Save bltavares/2927102 to your computer and use it in GitHub Desktop.
Save bltavares/2927102 to your computer and use it in GitHub Desktop.
wcc 12.24
import Data.List
longestSubset xs = last $ sortBy summing $ subsets xs
where subsets = concatMap inits . tails
summing x y = sum x `compare` sum y
main = do
let arry = [(-2), 1, (-3), 4, (-1), 2, 1, (-5), 4]
print $ longestSubset arry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment