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]]
Lists
Fundamentals
Similar Kata:
Stats:
Created | Oct 23, 2014 |
Published | Oct 23, 2014 |
Warriors Trained | 769 |
Total Skips | 94 |
Total Code Submissions | 993 |
Total Times Completed | 247 |
Haskell Completions | 247 |
Total Stars | 22 |
% of votes with a positive feedback rating | 94% of 71 |
Total "Very Satisfied" Votes | 63 |
Total "Somewhat Satisfied" Votes | 7 |
Total "Not Satisfied" Votes | 1 |