Skip to content

Conversation

@Abhayjaat999
Copy link

No description provided.

Comment on lines +1 to +4

//* @param {number[]} nums
//* @return {number[][]}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the initial state.

Suggested change
//* @param {number[]} nums
//* @return {number[][]}
/**
* @param {number[]} nums
* @return {number[][]}
*/

Comment on lines +5 to +22
var subsets = function(nums) {
let result=[]

const dfs=(i,nums,slate)=>{

if(i===nums.length){
result.push(slate.slice())
return
}

dfs(i+1,nums,slate)
slate.push(nums[i])
dfs(i+1,nums,slate)
slate.pop()
}
dfs(0,nums,[])
return result
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the code, we have certain formatting requirements. Prettier configuration files have been added to the project and can be formatted using an IDE.

Suggested change
var subsets = function(nums) {
let result=[]
const dfs=(i,nums,slate)=>{
if(i===nums.length){
result.push(slate.slice())
return
}
dfs(i+1,nums,slate)
slate.push(nums[i])
dfs(i+1,nums,slate)
slate.pop()
}
dfs(0,nums,[])
return result
};
var subsets = function (nums) {
let result = [];
const dfs = (i, nums, slate) => {
if (i === nums.length) {
result.push(slate.slice());
return;
}
dfs(i + 1, nums, slate);
slate.push(nums[i]);
dfs(i + 1, nums, slate);
slate.pop();
};
dfs(0, nums, []);
return result;
};

Copy link
Member

@YangFong YangFong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, we also require that the solution be put into the corresponding README.md and README_EN.md files, see the other commits.

@yanglbme yanglbme closed this Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants