refactor: fix typo in class name LongestNonRepetitiveSubstring (#5359)

This commit is contained in:
Alex Klymenko
2024-08-22 11:37:52 +02:00
committed by GitHub
parent 622a3bf795
commit 74b05ef7c2
2 changed files with 7 additions and 6 deletions

View File

@ -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<Character, Integer> map = new HashMap<>();
Map<Character, Integer> map = new HashMap<>();
while (i < s.length()) {
char temp = s.charAt(i);