Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev committed Dec 24, 2024
1 parent 90a0323 commit 2866470
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public int minLength(String s, int numOps) {

private boolean check(int sz, List<Integer> seg, int ops) {
for (int i : seg) {
if (i <= sz) {
continue;
}
int x = i / (sz + 1);
ops -= x;
if (ops < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ void minLength2() {
void minLength3() {
assertThat(new Solution().minLength("0101", 0), equalTo(1));
}

@Test
void minLength4() {
assertThat(new Solution().minLength("000", 0), equalTo(3));
}
}

0 comments on commit 2866470

Please sign in to comment.