File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .ArrayList ;
4
4
import java .util .List ;
5
5
6
- /**
7
- * 78. Subsets
8
- *
9
- * Given a set of distinct integers, nums, return all possible subsets.
10
- * Note: The solution set must not contain duplicate subsets.
11
-
12
- For example,
13
- If nums = [1,2,3], a solution is:
14
- [
15
- [3],
16
- [1],
17
- [2],
18
- [1,2,3],
19
- [1,3],
20
- [2,3],
21
- [1,2],
22
- []
23
- ]
24
- */
25
-
26
6
public class _78 {
27
7
28
8
public static class Solution1 {
@@ -47,7 +27,9 @@ public List<List<Integer>> subsets(int[] nums) {
47
27
}
48
28
49
29
public static class Solution2 {
50
- /**This is the most straightforward solution and easy to follow.*/
30
+ /**
31
+ * This is the most straightforward solution and easy to follow.
32
+ */
51
33
public List <List <Integer >> subsets (int [] nums ) {
52
34
List <List <Integer >> result = new ArrayList ();
53
35
backtracking (result , new ArrayList (), nums , 0 );
You can’t perform that action at this time.
0 commit comments