Skip to content

Commit 334d6a8

Browse files
Create MinimumWindowSubstringTest.java
1 parent 6d8d82e commit 334d6a8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.thealgorithms.slidingwindow;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
/**
8+
* Unit tests for the MinimumWindowSubstring class.
9+
*
10+
* @author (https://github.com/Chiefpatwal)
11+
*/
12+
public class MinimumWindowSubstringTest {
13+
14+
/**
15+
* Tests for MinimumWindowSubstring.minWindow.
16+
*/
17+
@Test
18+
public void testMinimumWindowSubstring() {
19+
assertEquals(4, MinimumWindowSubstring.minWindow("ADOBECODEBANC", "ABC")); // "BANC"
20+
assertEquals(1, MinimumWindowSubstring.minWindow("a", "a")); // "a"
21+
assertEquals(0, MinimumWindowSubstring.minWindow("a", "aa")); // ""
22+
}
23+
}

0 commit comments

Comments
 (0)