题目地址: [全排列](https://leetcode.cn/problems/permutations/) ``` var permute = function(nums) { let res = [] let fn = (path) => { if(path.length === nums.length) { res.push(path) return } nums.forEach(item => { if (!path.includes(item)) { fn(path.concat(item)) } }) } fn([]) return res }; ```
Activity