Merge pull request #54 from fusunx/master

添加 0078.子集.md Javascript
This commit is contained in:
Carl Sun
2021-05-13 09:12:29 +08:00
committed by GitHub

View File

@ -210,7 +210,24 @@ Python
Go Go
Javascript:
```Javascript
var subsets = function(nums) {
let result = []
let path = []
function backtracking(startIndex) {
result.push(path.slice())
for(let i = startIndex; i < nums.length; i++) {
path.push(nums[i])
backtracking(i + 1)
path.pop()
}
}
backtracking(0)
return result
};
```
----------------------- -----------------------