Open ghost opened 2 years ago
Thanks for opening your first issue here! Be sure to follow the issue template!
Hi @supaamucho, I will wait for your pull request.
Hi @ming-tsai , I'm interested in tackling this issue if no one is working on it.
Hi @supaamucho, Are you working on this?
Information about Algorithm
The algorithm returns an array of all the possible permutations (not combinations because order matters here) of x elements (x being one of the algorithm's parameters) in any given array of size n. For instance, if the input array is [1,2,3,4,5] and x = 2, the return would start like this: [[1,1],[1,2],[1,3]...] The algorithm uses a recursive approach and enables the inclusion or the exclusion of replicates through a boolean argument). In other words, the algorithm has three parameters: an input array of length n, the number of elements per permutation called x and a boolean value (true = replicates accepted and false = replicates excluded). It returns an array of all the possible permutations. For instance, allPermutations([1,2,3,4,5], 2, false) would return something that would start with [[1,2],[1,3],[1,4]...]
Have you read the Contributing.md and Code of conduct
Other context
This is a common problem for people dealing with probabilities (and statistics more generally). It is also a recurring problem on competitive platforms.