获取数组中指定大小的所有组合
源数组
组合大小
所有可能的组合数组
const array = [1, 2, 3];const combos = getCombinations(array, 2);// 返回[[1,2], [1,3], [2,3]] Copy
const array = [1, 2, 3];const combos = getCombinations(array, 2);// 返回[[1,2], [1,3], [2,3]]
获取数组中指定大小的所有组合