Skip to content

Commit 17e9f94

Browse files
authored
Added test for 539.
1 parent 99e84cd commit 17e9f94

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,27 @@ void findMinDifference3() {
3333
});
3434
assertThat(new Solution().findMinDifference(timePoints), equalTo(0));
3535
}
36+
37+
@Test
38+
void findMinDifference4() {
39+
List<String> timePoints = new ArrayList<>();
40+
int index = 0;
41+
while (index < 301) {
42+
int hour = index / 60 % 24;
43+
int minute = index % 60;
44+
timePoints.add(
45+
String.format(
46+
"%s:%s",
47+
hour < 10 ? "0" + hour : hour, minute < 10 ? "0" + minute : minute));
48+
index++;
49+
hour = index / 60 % 24;
50+
minute = index % 60;
51+
timePoints.add(
52+
String.format(
53+
"%s:%s",
54+
hour < 10 ? "0" + hour : hour, minute < 10 ? "0" + minute : minute));
55+
index++;
56+
}
57+
assertThat(new Solution().findMinDifference(timePoints), equalTo(1));
58+
}
3659
}

0 commit comments

Comments
 (0)