Given two integers n and r, I want to generate all possible combinations with the following rules: There are n distinct numbers to choose from, 1, 2, ..., n; Ea
So I came up with a problem that I can’t logically solve. I’ve fleshed out an example; You have a list of numbers that you need to output (e.g. 3x n
list_a = [1, 2, 3] I want to print all the unique combinations from the list like this [ [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3] ] Note: Without usin
I have been looking on google and stack overflow for a few hours and I am sure there is an answer for what this is mathematically or perhaps it is just what the
I am new user learning python. I have query if it can be done or not. If user input a word suppose "Dance" and characters are "$" and "@", he would get a all po
I have an array of numbers, now I want to find all possible subset sums and get the top z elements in it. Example: Input : arr[] = {2, 4, 5}, z = 3 SubsetSums
I am trying to find all possible unique combinations in R. It seems that there have been a lot of similar questions asked, but I was not able to find the same o
I'm working with lists in Python. I have a list of colleagues which is colleagues=['Jack', 'Jessica' 'John', 'Mark', 'Mary', 'Paul'] I want to calculate all po
I have a routing sequence for a set of machines on an assembly line. Each route has to go through the entire line (that is, if you only run the first and second
I'm trying to take one dataframe and create another, with all possible combinations of the columns and the difference between the corresponding values, i.e on 1
I have a data frame that looks something like this: my_data <- data.frame( letter = c("x","x","x","x","x","y","y","y","y","z","z","z","z"), number = c
I have a table of locations (right now in dataframe) and want to calculate all combinations and their distance from eachother. Input: ID Lat Lon 1 6,4355 53,22
I am using R and I would like to remove combinations in a data.frame. Unique function does not seem to do the job. a b c 1 1 4 A 2 2 3 B 3
I provide two data structures, cart_info and map_case, and get the result real_combinationby the algorithm. This algorithm is implemented in python import itert
Find the Access Codes Write a function answer(l) that takes a list of positive integers l and counts the number of "lucky triples" of (lst[i], lst[j], lst[k])
I have a very inefficient way of counting the combinations of N/2 items from an array of size N. What I do is sort the array to begin with and then loop through
I was trying to write a algorithm in javascript that returns all the possible 3 digit numbers numbers from a given array of length 6 For Example var arr = [1, 2
Input: [1, 2, 3] [a, b] Expected Output: [(1,a),(1,b),(2,a),(2,b),(3,a),(3,b)] This works, but is there a better way without an if statemen
I have used the following function to generate fund combinations in a portfolio. For example, I have four funds in the portfolio. The incremental change of each
I've seen several similar questions about how to generate all possible combinations of elements in an array. But I'm having a very hard time figuring out how to