題目:JavaScript實(shí)現(xiàn)笛卡爾乘積,一般用于商品sku屬性配置,例如輸入['1','2'],['a','b'],['+','-','x'],輸出['1a+','2a+','1b+','2b+','1a-','2a-','1b-','2b-','1ax','2ax','1bx','2bx']
解決方案:case1
case2若:考察的是dfs全排列,而不是復(fù)雜reduce/map
題目:JavaScript實(shí)現(xiàn)笛卡爾乘積,一般用于商品sku屬性配置,例如輸入['1','2'],['a','b'],['+','-','x'],輸出['1a+','2a+','1b+','2b+','1a-','2a-','1b-','2b-','1ax','2ax','1bx','2bx']
解決方案:case1
case2若:考察的是dfs全排列,而不是復(fù)雜reduce/map