combinations Questions
1
Solved
I am working on a project where very specific scheduling is needed (and why I am not using a library). It works, but I am trying to find a faster solution to the following problem:
We have employe...
Moxa asked 29/6, 2019 at 20:14
1
Solved
For positive integers n and k, let a "k-partition of n" be a sorted list of k distinct positive integers that add up to n, and let the "rank" of a given k-partition of n be its position in the sort...
Powered asked 26/6, 2019 at 21:16
1
Solved
I want to rank and unrank combinations with an Element distance constraint. Selected elements cannot repeated.
For example:
n := 10 elements choose from
k := 5 elements being choosen
d := 3 max...
Richert asked 20/6, 2019 at 20:14
3
Solved
I need to be able to create a boolean array of one combination and run it through a program to see if it works. If not then I dispose of it and go to the next combination. My issue is that I don't ...
Saunders asked 19/11, 2014 at 2:10
2
Solved
EXAMPLE
Given an array [1,2,3] or [1,2,3,4] ,print all unique combinations for length 3.
CODE
public class PrintCombo {
public void printCombo(int [] a, int [] buffer, int startIndex, int buff...
Dever asked 9/6, 2019 at 15:22
7
The problem is: Given a collection of numbers that might contain duplicates, return all unique permutations.
The naive way is using a set (in C++) to hold the permutations. This takes O(n! × log(n...
Preserve asked 11/7, 2012 at 3:21
6
Solved
I need to be able to make a list that contains all possible combinations of an inputted list.
For example the list [1,2,3] should return [1 [1,2] [1,3] 2 [2,3] 3 [1,2,3]]
The list doesn't hav...
Whencesoever asked 3/12, 2011 at 23:28
1
I have a list of unique tuples each containing 2 elements from 1 to 10. A total number of elements in a list is 45. I would like to divide them into 10 groups each of them containing only numbers f...
Akins asked 28/5, 2019 at 11:4
1
Solved
At a high level, I'm trying to sample n_samples items across all combinations of n items from a list. At small values of n and relatively small list lengths (n <= 5, len(list) < 75) this is f...
Excruciating asked 30/4, 2019 at 17:45
3
Solved
I am using expand.grid to generate all of the pairs of the elements of a vector, such as:
v <- 1:3
expand.grid(v,v)
Which gives:
Var1 Var2
1 1 1
2 2 1
3 3 1
4 1 2
5 2 2
6 3 2
7 1 3
8 2 3
9 ...
Colleague asked 16/10, 2013 at 17:13
6
Solved
Is it possible to create some Linq that generates a List containing all possible combinations of a series of numbers??
If you enter "21" it would generate a list with the elements:
list[0] = "21"...
Jampacked asked 21/4, 2009 at 20:30
1
Solved
I'm using the following code to generate a list of combinations of size s:
public static <T extends Comparable<? super T>> List<List<T>> combinations(List<T> items, i...
Middleweight asked 3/4, 2019 at 4:29
3
Solved
This questions was asked previously but only for vectors with non-repeating elements. I was not able to find an easy solution to get all combinations from a vector with repeating elements. To illus...
Doughman asked 14/3, 2019 at 13:38
1
I am trying two different lines of code that both involve computing combinations of rows of a df with 500k rows.
I think bc of the large # of combinations, the kernal keeps dying. Is there anyway...
Lillia asked 11/3, 2019 at 7:43
2
Solved
im facing a problem in which I have to generate a huge amount of code, all of it fairly similar, and I want to know if there is any way to templatized.
Lets say I have a structure of this type
t...
Gaggle asked 4/3, 2019 at 17:23
5
Solved
I have an Array of String and I want to find all the possible combinations of its element
For Example :
Array = [A,B,C,D]
should produce result as :
[A,AB,AC,AD,ABC,ABD,ACD,ABCD,B,BC,BD...
Mudlark asked 26/8, 2016 at 7:20
5
Solved
Let's say we have such an array:
myArray = [A, A, B, B, C, C, D, E]
I would like to create an algorithm so that it will find all the combinations that add up to the whole array, where none of the ...
Epicene asked 8/2, 2019 at 15:59
7
Solved
I tied to simplify the task as much as possible, so I could apply it to my algorithm.
And here is the challenge for mathematicians and programmers:
I need to create a method where I pass paramete...
Cochineal asked 6/6, 2012 at 23:12
1
Solved
I have a sentence (string) and a function that generates all synonyms of a given word from WordNet. I would like to produce a list of all possible variations of my sentence based on its synonyms.
...
Mitsukomitt asked 23/1, 2019 at 15:16
12
Solved
For this array, trying something like this:
void rollover(int val,int count) {
if(count==0) {
return;
}
printf("%d ",val);
count--;
rollover(val,count);
}
int main() {
int arr[]={0,1};
f...
Geoponics asked 22/4, 2013 at 15:17
2
Solved
I'm trying to get groups of permutations/combinations (r=2) that each member appear only once
I used python 'combinations' package to have the combinations.
For example: the members are: a,b,c,d...
Sourpuss asked 15/1, 2019 at 13:57
2
Solved
TL;DR: I want the exact behavior as filter ((== 4) . length) . subsequences. Just using subsequences also creates variable length of lists, which takes a lot of time to process. Since in the end on...
Evince asked 10/1, 2019 at 13:34
5
Solved
I have the following 2D array:
String[M][]
String[0]
"1","2","3"
String[1]
"A", "B"
.
.
.
String[M-1]
"!"
All the possible combinations should be in store in a resulting array
String[] ...
Deathtrap asked 7/4, 2013 at 23:5
3
Solved
I don't know much about Excel and I'm trying to do the following:
So, if a I had column A and column B:
A B
red green
red green
red green
blue pink
blue pink
blue pink
blue pink
black w...
Digitize asked 15/9, 2013 at 21:33
2
Solved
I have the following four equations (a,b,c,d), with several different variables (x,t,v,w,n,f). My goal would be to try and find all sets of variable values that would generate all positive (and non...
Mischiefmaker asked 13/12, 2018 at 19:17
© 2022 - 2024 — McMap. All rights reserved.