summaryrefslogtreecommitdiff
path: root/21-28/26.hs
diff options
context:
space:
mode:
Diffstat (limited to '21-28/26.hs')
-rw-r--r--21-28/26.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/21-28/26.hs b/21-28/26.hs
new file mode 100644
index 0000000..cbc469b
--- /dev/null
+++ b/21-28/26.hs
@@ -0,0 +1,5 @@
+combinations :: Int -> [a] -> [[a]]
+
+combinations 0 _ = [[]]
+combinations _ [] = []
+combinations k (x:xs) = [x:t | t <- combinations (k - 1) xs] ++ combinations k xs