File tree Expand file tree Collapse file tree 2 files changed +12
-18
lines changed
main/java/com/github/saser/adventofcode/year2016/day15
test/java/com/github/saser/adventofcode/year2016/day15 Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ public static Result part2(Reader r) {
21
21
22
22
private static Result solve (Reader r , int part ) {
23
23
var discs = Day15 .parse (r );
24
+ if (part == 2 ) {
25
+ discs .add (new Tuple3 <>(discs .size () + 1L , 11L , 0L ));
26
+ }
24
27
var equations = discs .stream ()
25
28
.map (tuple -> {
26
29
var disc = tuple .v1 ;
Original file line number Diff line number Diff line change @@ -27,22 +27,13 @@ public void part1Actual() throws IOException {
27
27
}
28
28
}
29
29
30
- // @Test
31
- // public void part2Example() {
32
- // var input = new StringReader("");
33
- // var output = "";
34
- // var result = Day15.part2(input);
35
- // Assert.assertEquals("no error", "", result.error);
36
- // Assert.assertEquals("correct output", output, result.answer);
37
- // }
38
-
39
- // @Test
40
- // public void part2Actual() throws IOException {
41
- // try (var input = new FileReader("inputs/2016/15")) {
42
- // var output = "";
43
- // var result = Day15.part2(input);
44
- // Assert.assertEquals("no error", "", result.error);
45
- // Assert.assertEquals("correct output", output, result.answer);
46
- // }
47
- // }
30
+ @ Test
31
+ public void part2Actual () throws IOException {
32
+ try (var input = new FileReader ("inputs/2016/15" )) {
33
+ var output = "2353212" ;
34
+ var result = Day15 .part2 (input );
35
+ Assert .assertEquals ("no error" , "" , result .error );
36
+ Assert .assertEquals ("correct output" , output , result .answer );
37
+ }
38
+ }
48
39
}
You can’t perform that action at this time.
0 commit comments