Skip to content

Commit a97458c

Browse files
committed
Added tasks 3658-3661
1 parent e1d54f4 commit a97458c

File tree

4 files changed

+64
-50
lines changed

4 files changed

+64
-50
lines changed
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
package g3601_3700.s3658_gcd_of_odd_and_even_sums;
1+
package g3601_3700.s3658_gcd_of_odd_and_even_sums
22

3-
import static org.hamcrest.CoreMatchers.equalTo;
4-
import static org.hamcrest.MatcherAssert.assertThat;
3+
import org.hamcrest.CoreMatchers.equalTo
4+
import org.hamcrest.MatcherAssert.assertThat
5+
import org.junit.jupiter.api.Test
56

6-
import org.junit.jupiter.api.Test;
7-
8-
class SolutionTest {
7+
internal class SolutionTest {
98
@Test
10-
void gcdOfOddEvenSums() {
11-
assertThat(new Solution().gcdOfOddEvenSums(4), equalTo(4));
9+
fun gcdOfOddEvenSums() {
10+
assertThat<Int>(Solution().gcdOfOddEvenSums(4), equalTo<Int>(4))
1211
}
1312

1413
@Test
15-
void gcdOfOddEvenSums2() {
16-
assertThat(new Solution().gcdOfOddEvenSums(5), equalTo(5));
14+
fun gcdOfOddEvenSums2() {
15+
assertThat<Int>(Solution().gcdOfOddEvenSums(5), equalTo<Int>(5))
1716
}
1817
}
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
1-
package g3601_3700.s3659_partition_array_into_k_distinct_groups;
1+
package g3601_3700.s3659_partition_array_into_k_distinct_groups
22

3-
import static org.hamcrest.CoreMatchers.equalTo;
4-
import static org.hamcrest.MatcherAssert.assertThat;
3+
import org.hamcrest.CoreMatchers.equalTo
4+
import org.hamcrest.MatcherAssert.assertThat
5+
import org.junit.jupiter.api.Test
56

6-
import org.junit.jupiter.api.Test;
7-
8-
class SolutionTest {
7+
internal class SolutionTest {
98
@Test
10-
void partitionArray() {
11-
assertThat(new Solution().partitionArray(new int[] {1, 2, 3, 4}, 2), equalTo(true));
9+
fun partitionArray() {
10+
assertThat<Boolean>(
11+
Solution().partitionArray(intArrayOf(1, 2, 3, 4), 2),
12+
equalTo<Boolean>(true),
13+
)
1214
}
1315

1416
@Test
15-
void partitionArray2() {
16-
assertThat(new Solution().partitionArray(new int[] {3, 5, 2, 2}, 2), equalTo(true));
17+
fun partitionArray2() {
18+
assertThat<Boolean>(
19+
Solution().partitionArray(intArrayOf(3, 5, 2, 2), 2),
20+
equalTo<Boolean>(true),
21+
)
1722
}
1823

1924
@Test
20-
void partitionArray3() {
21-
assertThat(new Solution().partitionArray(new int[] {1, 5, 2, 3}, 3), equalTo(false));
25+
fun partitionArray3() {
26+
assertThat<Boolean>(
27+
Solution().partitionArray(intArrayOf(1, 5, 2, 3), 3),
28+
equalTo<Boolean>(false),
29+
)
2230
}
2331
}
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
package g3601_3700.s3660_jump_game_ix;
1+
package g3601_3700.s3660_jump_game_ix
22

3-
import static org.hamcrest.CoreMatchers.equalTo;
4-
import static org.hamcrest.MatcherAssert.assertThat;
3+
import org.hamcrest.CoreMatchers.equalTo
4+
import org.hamcrest.MatcherAssert.assertThat
5+
import org.junit.jupiter.api.Test
56

6-
import org.junit.jupiter.api.Test;
7-
8-
class SolutionTest {
7+
internal class SolutionTest {
98
@Test
10-
void maxValue() {
11-
assertThat(new Solution().maxValue(new int[] {2, 1, 3}), equalTo(new int[] {2, 2, 3}));
9+
fun maxValue() {
10+
assertThat<IntArray>(
11+
Solution().maxValue(intArrayOf(2, 1, 3)),
12+
equalTo<IntArray>(intArrayOf(2, 2, 3)),
13+
)
1214
}
1315

1416
@Test
15-
void maxValue2() {
16-
assertThat(new Solution().maxValue(new int[] {2, 3, 1}), equalTo(new int[] {3, 3, 3}));
17+
fun maxValue2() {
18+
assertThat<IntArray>(
19+
Solution().maxValue(intArrayOf(2, 3, 1)),
20+
equalTo<IntArray>(intArrayOf(3, 3, 3)),
21+
)
1722
}
1823
}
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1-
package g3601_3700.s3661_maximum_walls_destroyed_by_robots;
1+
package g3601_3700.s3661_maximum_walls_destroyed_by_robots
22

3-
import static org.hamcrest.CoreMatchers.equalTo;
4-
import static org.hamcrest.MatcherAssert.assertThat;
3+
import org.hamcrest.CoreMatchers.equalTo
4+
import org.hamcrest.MatcherAssert.assertThat
5+
import org.junit.jupiter.api.Test
56

6-
import org.junit.jupiter.api.Test;
7-
8-
class SolutionTest {
7+
internal class SolutionTest {
98
@Test
10-
void maxWalls() {
11-
assertThat(
12-
new Solution().maxWalls(new int[] {4}, new int[] {3}, new int[] {1, 10}),
13-
equalTo(1));
9+
fun maxWalls() {
10+
assertThat<Int>(
11+
Solution().maxWalls(intArrayOf(4), intArrayOf(3), intArrayOf(1, 10)),
12+
equalTo<Int>(1),
13+
)
1414
}
1515

1616
@Test
17-
void maxWalls2() {
18-
assertThat(
19-
new Solution().maxWalls(new int[] {10, 2}, new int[] {5, 1}, new int[] {5, 2, 7}),
20-
equalTo(3));
17+
fun maxWalls2() {
18+
assertThat<Int>(
19+
Solution().maxWalls(intArrayOf(10, 2), intArrayOf(5, 1), intArrayOf(5, 2, 7)),
20+
equalTo<Int>(3),
21+
)
2122
}
2223

2324
@Test
24-
void maxWalls3() {
25-
assertThat(
26-
new Solution().maxWalls(new int[] {1, 2}, new int[] {100, 1}, new int[] {10}),
27-
equalTo(0));
25+
fun maxWalls3() {
26+
assertThat<Int>(
27+
Solution().maxWalls(intArrayOf(1, 2), intArrayOf(100, 1), intArrayOf(10)),
28+
equalTo<Int>(0),
29+
)
2830
}
2931
}

0 commit comments

Comments
 (0)