Skip to content

Instantly share code, notes, and snippets.

@apage43
Created October 6, 2014 11:10
Show Gist options
  • Save apage43/2da6a0e1b3fb85bb92b6 to your computer and use it in GitHub Desktop.
Save apage43/2da6a0e1b3fb85bb92b6 to your computer and use it in GitHub Desktop.
import Math.Combinat.Sets (sublists)
topPops :: [Int]
topPops = [ 18897109, 12828837, 9461105, 6371773, 5965343, 5946800, 5582170, 5564635, 5268860, 4552402, 4335391, 4296250, 4224851, 4192887, 3439809, 3279833, 3095313, 2812896, 2783243, 2710489, 2543482, 2356285, 2226009, 2149127, 2142508, 2134411 ]
target :: Int
target = 100000000
sols :: [[Int]]
sols = filter ((== target) . sum) $ sublists topPops
main :: IO ()
main = print sols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment