Skip to content

Commit b3a89cb

Browse files
authored
Added test for 539.
1 parent aeeb97d commit b3a89cb

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/test/java/g0501_0600/s0539_minimum_time_difference/SolutionTest.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@
55

66
import java.util.ArrayList;
77
import java.util.Arrays;
8+
import java.util.List;
9+
import java.util.stream.IntStream;
810
import org.junit.jupiter.api.Test;
911

1012
class SolutionTest {
1113
@Test
1214
void findMinDifference() {
13-
assertThat(
14-
new Solution().findMinDifference(new ArrayList<>(Arrays.asList("23:59", "00:00"))),
15-
equalTo(1));
15+
assertThat(new Solution().findMinDifference(Arrays.asList("23:59", "00:00")), equalTo(1));
1616
}
1717

1818
@Test
1919
void findMinDifference2() {
2020
assertThat(
21-
new Solution()
22-
.findMinDifference(
23-
new ArrayList<>(Arrays.asList("00:00", "23:59", "00:00"))),
21+
new Solution().findMinDifference(Arrays.asList("00:00", "23:59", "00:00")),
2422
equalTo(0));
2523
}
24+
25+
@Test
26+
void findMinDifference3() {
27+
List<String> timePoints = new ArrayList<>();
28+
IntStream.rangeClosed(0, 310 / 2)
29+
.forEach(
30+
index -> {
31+
timePoints.add("23:59");
32+
timePoints.add("00:00");
33+
});
34+
assertThat(new Solution().findMinDifference(timePoints), equalTo(0));
35+
}
2636
}

0 commit comments

Comments
 (0)