Skip to content

Commit 1446a31

Browse files
Create MinimumWindowSubstringTest.java
1 parent ef681e8 commit 1446a31

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 LongestSubstringWithoutRepeatingCharacters class.
9+
*
10+
* @author (https://github.com/Chiefpatwal)
11+
*/
12+
public class MinimumWindowSubstringTest {
13+
14+
/**
15+
* Tests for the longest subarray with a sum less than or equal to k.
16+
*/
17+
@Test
18+
public void testMinimumWindowSubstring() {
19+
assertEquals(3, MinimumWindowSubstring.minWindow("ADOBECODEBANC","ABC"); // "BANC"
20+
assertEquals(4, MinimumWindowSubstring.minWindow("a","a"); // "a"
21+
assertEquals(2, MinimumWindowSubstring.minWindow("a","aa" // ""
22+
}
23+
}

0 commit comments

Comments
 (0)