6 kyu

Combinations

Description:

A combination is a way of selecting members from a group in which the order does not matter.

Write a function that returns all the combinations of a given size from a list.

combinations :: Int -> [a] -> [[a]]

examples:

combinations 1 [1,2,3] should be [[1],[2],[3]]

combinations 2 [1,2,3] should be [[1,2],[1,3],[2,3]]

http://en.wikipedia.org/wiki/Combination

Lists
Fundamentals

Similar Kata:

Stats:

CreatedOct 23, 2014
PublishedOct 23, 2014
Warriors Trained769
Total Skips94
Total Code Submissions993
Total Times Completed247
Haskell Completions247
Total Stars22
% of votes with a positive feedback rating94% of 71
Total "Very Satisfied" Votes63
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes1
Ad
Contributors
  • ninjasmodyurt Avatar
  • alchemy Avatar
  • ice1000 Avatar
  • solitude Avatar
Ad