summaryrefslogtreecommitdiff
path: root/H26.hs
diff options
context:
space:
mode:
Diffstat (limited to 'H26.hs')
-rw-r--r--H26.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/H26.hs b/H26.hs
new file mode 100644
index 0000000..4497e8c
--- /dev/null
+++ b/H26.hs
@@ -0,0 +1,5 @@
+combination :: Int -> [a] -> [[a]]
+combination 0 _ = [[]]
+combination _ [] = []
+combination c (x:xs) = (map (x:) (combination (c-1) xs)) ++ (combination c xs)
+