mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
更新 0078.子集.md 去除Java代码中冗余的部分
subsetsHelper(int[] nums, int startIndex)函数的第一行包含了被去除代码的功能,因此去掉主函数中冗余的代码
This commit is contained in:
@ -180,10 +180,6 @@ class Solution {
|
||||
List<List<Integer>> result = new ArrayList<>();// 存放符合条件结果的集合
|
||||
LinkedList<Integer> path = new LinkedList<>();// 用来存放符合条件结果
|
||||
public List<List<Integer>> subsets(int[] nums) {
|
||||
if (nums.length == 0){
|
||||
result.add(new ArrayList<>());
|
||||
return result;
|
||||
}
|
||||
subsetsHelper(nums, 0);
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user