Answer the question
In order to leave comments, you need to log in
How to write an algorithm that returns all possible combinations of array elements?
Given:
Data structure with nested arrays looks like this (js):
[
[ 1,2,3],
[ 4,5,6],
[ 7, 8, 9]
]
[
[1,4,7],
[1,4,8],
[1,4,9],
[1,5,7]
...
Answer the question
In order to leave comments, you need to log in
You are essentially asking to write a solution for you, and probably even someone will do it, but this is prohibited by the rules of this site. You can ask for help and tips, but do not solve problems for you.
To solve the problem, you do not need to be a mathematician, but you just need to read about nested loops and analyze a few examples, of which there are a million on the Internet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question