Skip to content

Commit 035d838

Browse files
committed
Added tests
1 parent b05f2e5 commit 035d838

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

src/test/java/g3601_3700/s3698_split_array_with_minimum_difference/SolutionTest.java

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,124 @@ void splitArray2() {
2020
void splitArray3() {
2121
assertThat(new Solution().splitArray(new int[] {3, 1, 2}), equalTo(-1L));
2222
}
23+
24+
@Test
25+
void splitArray4() {
26+
int[] nums = {1, 2, 3, 4, 5};
27+
assertThat(new Solution().splitArray(nums), equalTo(5L));
28+
}
29+
30+
@Test
31+
void splitArray5() {
32+
int[] nums = {10};
33+
assertThat(new Solution().splitArray(nums), equalTo(10L));
34+
}
35+
36+
@Test
37+
void splitArray6() {
38+
int[] nums = {3, 7};
39+
assertThat(new Solution().splitArray(nums), equalTo(4L));
40+
}
41+
42+
@Test
43+
void splitArray7() {
44+
int[] nums = {1, 2, 2, 1};
45+
assertThat(new Solution().splitArray(nums), equalTo(0L));
46+
}
47+
48+
@Test
49+
void splitArray8() {
50+
int[] nums = {1, 3, 2, 0};
51+
assertThat(new Solution().splitArray(nums), equalTo(2L));
52+
}
53+
54+
@Test
55+
void splitArray9() {
56+
int[] nums = {1, 2, 1, 3};
57+
assertThat(new Solution().splitArray(nums), equalTo(-1L));
58+
}
59+
60+
@Test
61+
void splitArray10() {
62+
int[] nums = {2, 4, 3, 1, 2};
63+
assertThat(new Solution().splitArray(nums), equalTo(-1L));
64+
}
65+
66+
@Test
67+
void splitArray11() {
68+
int[] nums = {1, 2, 5, 4, 3};
69+
assertThat(new Solution().splitArray(nums), equalTo(1L));
70+
}
71+
72+
@Test
73+
void splitArray12() {
74+
int[] nums = {5, 10, 2, 1};
75+
assertThat(new Solution().splitArray(nums), equalTo(8L));
76+
}
77+
78+
@Test
79+
void splitArray13() {
80+
int[] nums = {2, 3, 1};
81+
assertThat(new Solution().splitArray(nums), equalTo(2L));
82+
}
83+
84+
@Test
85+
void splitArray14() {
86+
int[] nums = {10, 20, 15, 5};
87+
assertThat(new Solution().splitArray(nums), equalTo(10L));
88+
}
89+
90+
@Test
91+
void splitArray15() {
92+
int[] nums = {5, 4, 3, 2, 1};
93+
assertThat(new Solution().splitArray(nums), equalTo(5L));
94+
}
95+
96+
@Test
97+
void splitArray16() {
98+
int[] nums = {3, 3, 3, 2, 1};
99+
assertThat(new Solution().splitArray(nums), equalTo(-1L));
100+
}
101+
102+
@Test
103+
void splitArray17() {
104+
int[] nums = {1, 0};
105+
assertThat(new Solution().splitArray(nums), equalTo(1L));
106+
}
107+
108+
@Test
109+
void splitArray18() {
110+
int[] nums = {2, 4, 4, 2};
111+
assertThat(new Solution().splitArray(nums), equalTo(0L));
112+
}
113+
114+
@Test
115+
void splitArray19() {
116+
int[] nums = {1, 10, 9, 8, 7};
117+
assertThat(new Solution().splitArray(nums), equalTo(13L));
118+
}
119+
120+
@Test
121+
void splitArray20() {
122+
int[] nums = {1, 3, 2, 4, 1};
123+
assertThat(new Solution().splitArray(nums), equalTo(-1L));
124+
}
125+
126+
@Test
127+
void splitArray21() {
128+
int[] nums = {5, 5, 4, 3};
129+
assertThat(new Solution().splitArray(nums), equalTo(7L));
130+
}
131+
132+
@Test
133+
void splitArray22() {
134+
int[] nums = {100, 200, 10, 5};
135+
assertThat(new Solution().splitArray(nums), equalTo(115L));
136+
}
137+
138+
@Test
139+
void splitArray23() {
140+
int[] nums = {3, 5, 2};
141+
assertThat(new Solution().splitArray(nums), equalTo(4L));
142+
}
23143
}

0 commit comments

Comments
 (0)