Skip to content

Instantly share code, notes, and snippets.

@sphynx
Created February 8, 2011 22:26
Show Gist options
  • Save sphynx/817407 to your computer and use it in GitHub Desktop.
Save sphynx/817407 to your computer and use it in GitHub Desktop.
Task 3
module Main where
d = [3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99]
superset [] = [[]]
superset (x:xs) = ss ++ map (x:) ss
where ss = superset xs
check [] = False
check xs = m == sum xs - m where m = maximum xs
res = length . filter check . superset $ d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment