6 kyu
Array combinations
945 of 2,670KenKamau
Description:
In this Kata, you will be given an array of arrays and your task will be to return the number of unique arrays that can be formed by picking exactly one element from each subarray.
For example: solve([[1,2],[4],[5,6]]) = 4
, because it results in only 4
possibilites. They are [1,4,5],[1,4,6],[2,4,5],[2,4,6]
.
Make sure that you don't count duplicates; for example solve([[1,2],[4,4],[5,6,6]]) = 4
, since the extra outcomes are just duplicates.
See test cases for more examples.
Good luck!
If you like this Kata, please try:
Fundamentals
Combinatorics
Similar Kata:
Stats:
Created | Oct 17, 2017 |
Published | Oct 17, 2017 |
Warriors Trained | 5160 |
Total Skips | 237 |
Total Code Submissions | 6882 |
Total Times Completed | 2670 |
Ruby Completions | 95 |
Python Completions | 945 |
JavaScript Completions | 1139 |
R Completions | 53 |
Haskell Completions | 79 |
Java Completions | 196 |
C++ Completions | 142 |
C Completions | 82 |
Go Completions | 77 |
Scala Completions | 9 |
Total Stars | 88 |
% of votes with a positive feedback rating | 94% of 583 |
Total "Very Satisfied" Votes | 522 |
Total "Somewhat Satisfied" Votes | 51 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 3 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |