forked from adnanaziz/EPIJudge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Combinations.java
34 lines (32 loc) · 1.04 KB
/
Combinations.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package epi;
import epi.test_framework.EpiTest;
import epi.test_framework.EpiTestComparator;
import epi.test_framework.LexicographicalListComparator;
import epi.test_framework.GenericTest;
import java.util.Collections;
import java.util.List;
import java.util.function.BiPredicate;
public class Combinations {
@EpiTest(testDataFile = "combinations.tsv")
public static List<List<Integer>> combinations(int n, int k) {
// TODO - you fill in here.
return null;
}
@EpiTestComparator
public static BiPredicate<List<List<Integer>>, List<List<Integer>>> comp =
(expected, result) -> {
if (result == null) {
return false;
}
expected.sort(new LexicographicalListComparator<>());
result.sort(new LexicographicalListComparator<>());
return expected.equals(result);
};
public static void main(String[] args) {
System.exit(
GenericTest
.runFromAnnotations(args, "Combinations.java",
new Object() {}.getClass().getEnclosingClass())
.ordinal());
}
}