diff --git a/src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java b/src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java similarity index 87% rename from src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java rename to src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java index cc99a16f..c113162f 100644 --- a/src/main/java/com/thealgorithms/strings/LongestNonRepeativeSubstring.java +++ b/src/main/java/com/thealgorithms/strings/LongestNonRepetitiveSubstring.java @@ -1,16 +1,17 @@ package com.thealgorithms.strings; import java.util.HashMap; +import java.util.Map; -final class LongestNonRepeativeSubstring { - private LongestNonRepeativeSubstring() { +final class LongestNonRepetitiveSubstring { + private LongestNonRepetitiveSubstring() { } public static int lengthOfLongestSubstring(String s) { int max = 0; int start = 0; int i = 0; - HashMap map = new HashMap<>(); + Map map = new HashMap<>(); while (i < s.length()) { char temp = s.charAt(i); diff --git a/src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java b/src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java similarity index 50% rename from src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java rename to src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java index 4bd5ac99..c6fd8c59 100644 --- a/src/test/java/com/thealgorithms/strings/LongestNonRepeativeSubstringTest.java +++ b/src/test/java/com/thealgorithms/strings/LongestNonRepetitiveSubstringTest.java @@ -3,13 +3,13 @@ package com.thealgorithms.strings; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -public class LongestNonRepeativeSubstringTest { +public class LongestNonRepetitiveSubstringTest { @Test public void palindrome() { String input1 = "HelloWorld"; String input2 = "javaIsAProgrammingLanguage"; - Assertions.assertEquals(LongestNonRepeativeSubstring.lengthOfLongestSubstring(input1), 5); - Assertions.assertEquals(LongestNonRepeativeSubstring.lengthOfLongestSubstring(input2), 9); + Assertions.assertEquals(LongestNonRepetitiveSubstring.lengthOfLongestSubstring(input1), 5); + Assertions.assertEquals(LongestNonRepetitiveSubstring.lengthOfLongestSubstring(input2), 9); } }