Skip to content

Commit 042cb7d

Browse files
add tests for 3208
1 parent 1368fc8 commit 042cb7d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.fishercoder.fourththousand;
2+
3+
import com.fishercoder.solutions.fourththousand._3208;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertEquals;
8+
9+
public class _3208Test {
10+
private static _3208.Solution1 solution1;
11+
12+
@BeforeEach
13+
public void setup() {
14+
solution1 = new _3208.Solution1();
15+
}
16+
17+
@Test
18+
public void test1() {
19+
assertEquals(3, solution1.numberOfAlternatingGroups(new int[]{0, 1, 0, 1, 0}, 3));
20+
}
21+
22+
@Test
23+
public void test2() {
24+
assertEquals(2, solution1.numberOfAlternatingGroups(new int[]{0, 1, 0, 0, 1, 0, 1}, 6));
25+
}
26+
27+
@Test
28+
public void test3() {
29+
assertEquals(0, solution1.numberOfAlternatingGroups(new int[]{1, 1, 0, 1}, 4));
30+
}
31+
32+
@Test
33+
public void test4() {
34+
assertEquals(4, solution1.numberOfAlternatingGroups(new int[]{0, 1, 0, 1}, 3));
35+
}
36+
37+
}

0 commit comments

Comments
 (0)