leetcode 39. Combination Sum

Run Settings
LanguageHaskell
Language Version
Run Command
import Data.List cal :: [Int] -> Int -> [[Int]] cal xs 0 = [[]] cal xs sum = nub $ map sort $ concat [ map (x:) $ cal xs (sum - x) | x <- xs, x <= sum ] main = do putStrLn $ show $ cal [2, 3, 6, 7] 7 putStrLn $ show $ cal [2, 3, 5] 8
Editor Settings
Theme
Key bindings
Full width
Lines