This is a created article in which the information may have evolved or changed.
TODO: Permutation combination problem: N number of M
Permutation and combination is the most basic concept of combinatorial learning. The so-called arrangement refers to the ordering of the specified number of elements from the given number of elements. The combination refers to the only number of elements from the given number of elements, regardless of the order. The central problem with permutation combinations is to study the total number of possible scenarios for the permutations and combinations of a given requirement. The permutation combination is closely related to the classical probability theory.
The function of this article is to "sequentially" take the number of m from the n number, such as 1,2,3,4,5,6 take 5 numbers is: 1,2,3,4,5;1,2,3,4,6;2,3,4,5,6. Sample code has Javascript,php,golang, if similar, purely academic research, as a record, thank you for your support. The code is tested and can be used normally. The algorithm that uses factorial.
JS: Get n number of M number, how many groups of combinations
PHP: Get an array of n numbers from an array
Golang: Permutation combination problem: N number of M
Algorithm is the essence of software.
Wxgzh:ludong86