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:

Sum of integer combinations

Sum of array singles

Fundamentals
Combinatorics

Stats:

CreatedOct 17, 2017
PublishedOct 17, 2017
Warriors Trained5160
Total Skips237
Total Code Submissions6882
Total Times Completed2670
Ruby Completions95
Python Completions945
JavaScript Completions1139
R Completions53
Haskell Completions79
Java Completions196
C++ Completions142
C Completions82
Go Completions77
Scala Completions9
Total Stars88
% of votes with a positive feedback rating94% of 583
Total "Very Satisfied" Votes522
Total "Somewhat Satisfied" Votes51
Total "Not Satisfied" Votes10
Total Rank Assessments3
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • suic Avatar
  • Voile Avatar
  • mentalplex Avatar
  • clcraig Avatar
  • solitude Avatar
  • ejini战神 Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad