From 74b05ef7c2bf34f2d1acda5f75fdbd8653e728c1 Mon Sep 17 00:00:00 2001 From: Alex Klymenko Date: Thu, 22 Aug 2024 11:37:52 +0200 Subject: [PATCH] refactor: fix typo in class name `LongestNonRepetitiveSubstring` (#5359) --- ...veSubstring.java => LongestNonRepetitiveSubstring.java} | 7 ++++--- ...ingTest.java => LongestNonRepetitiveSubstringTest.java} | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) rename src/main/java/com/thealgorithms/strings/{LongestNonRepeativeSubstring.java => LongestNonRepetitiveSubstring.java} (87%) rename src/test/java/com/thealgorithms/strings/{LongestNonRepeativeSubstringTest.java => LongestNonRepetitiveSubstringTest.java} (50%) 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); } }