8000 refactor 39 · fhuang3311/Leetcode-1@ba98d8e · GitHub
[go: up one dir, main page]

Skip to content

Commit ba98d8e

Browse files
refactor 39
1 parent 9aa640a commit ba98d8e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.solutions._30;
4+
import com.fishercoder.solutions._39;
5+
import java.util.ArrayList;
6+
import java.util.Arrays;
7+
import java.util.List;
8+
import org.junit.BeforeClass;
9+
import org.junit.Test;
10+
11+
import static org.junit.Assert.assertEquals;
12+
13+
public class _39Test {
14+
private static _39.Solution1 solution1;
15+
private static int[] candidates;
16+
private static List<List<Integer>> expected;
17+
18+
@BeforeClass
19+
public static void setup() {
20+
solution1 = new _39.Solution1();
21+
}
22+
23+
@Test
24+
public void test1() {
25+
candidates = new int[] {2, 3, 6, 7};
26+
expected = new ArrayList<>();
27+
expected.add(Arrays.asList(2, 2, 3));
28+
expected.add(Arrays.asList(7));
29+
assertEquals(expected, solution1.combinationSum(candidates, 7));
30+
}
31+
}

0 commit comments

Comments
 (0)
0