/
NikolayIvkin
/
TheAlgorithms
Обзор
Документация
Войти
/
NikolayIvkin
/
TheAlgorithms
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/test/java/com/thealgorithms/slidingwindow/LongestSubstringWithoutRepeatingCharactersTest.java
23 строки
974 B
PANKAJ PATWAL
Add longest substring (#6007)
25 окт 2024, 23:18
Не верифицирован
25 окт 2024, 23:18
0f1dcbe
Код
Авторство
О чём код?
package com.thealgorithms.slidingwindow; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; /** * Unit tests for the LongestSubstringWithoutRepeatingCharacters class. * * @author (https://github.com/Chiefpatwal) */ public class LongestSubstringWithoutRepeatingCharactersTest { @Test public void testLengthOfLongestSubstring() { // Test cases for the lengthOfLongestSubstring method assertEquals(3, LongestSubstringWithoutRepeatingCharacters.lengthOfLongestSubstring("abcabcbb")); assertEquals(1, LongestSubstringWithoutRepeatingCharacters.lengthOfLongestSubstring("bbbbb")); assertEquals(3, LongestSubstringWithoutRepeatingCharacters.lengthOfLongestSubstring("pwwkew")); assertEquals(0, LongestSubstringWithoutRepeatingCharacters.lengthOfLongestSubstring("")); assertEquals(5, LongestSubstringWithoutRepeatingCharacters.lengthOfLongestSubstring("abcde")); } }