W
W
weranda2019-05-26 17:09:37
Python
weranda, 2019-05-26 17:09:37

How to generate all possible variants of X values?

Hello Podzagot
how to generate all possible options from a list of values. I remember that it refers to combinatorics, sort of, but I don’t remember it.
Let's say there are 1 and 2 and we have two options at the output: 12 and 21. And if we have more numbers / values, then how to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2019-05-26
@weranda

I didn't know, and I forgot. Combinatorial iterators will help.

A
Anton Shamanov, 2019-05-26
@SilenceOfWinter

https://www.programmingalgorithms.com/algorithm/br... simple brute force

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question