Answer the question
In order to leave comments, you need to log in
How to perform convolution of combinations?
I have a set of unique combinations of 3 numbers from different numbers from 1 to 100. Is there an algorithm for finding such sets of series of numbers that, when decomposed into combinations, will give the original set? Example:
Given:
1 2 3
1 2 4
1 3 4
2 3 4
Answer: 1 2 3 4
We need to find a set of new rows that minimizes the number of records.
Answer the question
In order to leave comments, you need to log in
The task is formulated in a strange way, but it seems that you just need to find all the unique numbers in the input.
Either use some set, or add all the input numbers into an array, sort and then remove consecutive elements repeating in a row.
No, not unique numbers.
There is a simple function that receives a string of numbers (for example, 7 different numbers in the range from 1 to 100), at the output it produces many combinations of 3 numbers - a total of 35 elements.
And I need an inverse function - by a set of combinations (no more than 10,000 elements) to determine from which rows of numbers this set can be obtained. It's kind of like reversible hashing, I guess.
While thoughts stop at counting the number of connections between all the numbers in the set
1 5 17
1 5 22
1 5 23
1 17 23
5 17 23
And the answer will be 2 rows:
1 5 17 23
1 5 22
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question