Skip to content

Commit 2866470

Browse files
committed
Added test
1 parent 90a0323 commit 2866470

File tree

2 files changed

+5
-3
lines changed
  • src
    • main/java/g3301_3400/s3399_smallest_substring_with_identical_characters_ii
    • test/java/g3301_3400/s3399_smallest_substring_with_identical_characters_ii

2 files changed

+5
-3
lines changed

src/main/java/g3301_3400/s3399_smallest_substring_with_identical_characters_ii/Solution.java

-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ public int minLength(String s, int numOps) {
5959

6060
private boolean check(int sz, List<Integer> seg, int ops) {
6161
for (int i : seg) {
62-
if (i <= sz) {
63-
continue;
64-
}
6562
int x = i / (sz + 1);
6663
ops -= x;
6764
if (ops < 0) {

src/test/java/g3301_3400/s3399_smallest_substring_with_identical_characters_ii/SolutionTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ void minLength2() {
2020
void minLength3() {
2121
assertThat(new Solution().minLength("0101", 0), equalTo(1));
2222
}
23+
24+
@Test
25+
void minLength4() {
26+
assertThat(new Solution().minLength("000", 0), equalTo(3));
27+
}
2328
}

0 commit comments

Comments
 (0)