cartesianProduct(arr) { return arr.reduce((a, b) => a.map(x => b.map(y => x.concat(y))).reduce((a, b) => a.concat(b), []), [[]])}
cartesianProduct(arr) { return arr.reduce((a, b) => a.map(x => b.map(y => x.concat(y))).reduce((a, b) => a.concat(b), []), [[]])}
本文标题:【js】多个数组的笛卡尔积
本文链接:https://www.haomeiwen.com/subject/nspsvqtx.html
网友评论