refactor: fix typo (#5372)
This commit is contained in:
parent
75355e87b6
commit
a7cd97d75e
@ -6,8 +6,8 @@ package com.thealgorithms.others;
|
|||||||
*
|
*
|
||||||
* @author AKS1996
|
* @author AKS1996
|
||||||
*/
|
*/
|
||||||
public final class GuassLegendre {
|
public final class GaussLegendre {
|
||||||
private GuassLegendre() {
|
private GaussLegendre() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
@ -17,8 +17,8 @@ public final class Isomorphic {
|
|||||||
// To mark the characters of string using MAP
|
// To mark the characters of string using MAP
|
||||||
// character of first string as KEY and another as VALUE
|
// character of first string as KEY and another as VALUE
|
||||||
// now check occurence by keeping the track with SET data structure
|
// now check occurence by keeping the track with SET data structure
|
||||||
Map<Character, Character> characterMap = new HashMap<Character, Character>();
|
Map<Character, Character> characterMap = new HashMap<>();
|
||||||
Set<Character> trackUinqueCharacter = new HashSet<Character>();
|
Set<Character> trackUniqueCharacter = new HashSet<>();
|
||||||
|
|
||||||
for (int i = 0; i < s.length(); i++) {
|
for (int i = 0; i < s.length(); i++) {
|
||||||
if (characterMap.containsKey(s.charAt(i))) {
|
if (characterMap.containsKey(s.charAt(i))) {
|
||||||
@ -26,13 +26,13 @@ public final class Isomorphic {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (trackUinqueCharacter.contains(t.charAt(i))) {
|
if (trackUniqueCharacter.contains(t.charAt(i))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
characterMap.put(s.charAt(i), t.charAt(i));
|
characterMap.put(s.charAt(i), t.charAt(i));
|
||||||
}
|
}
|
||||||
trackUinqueCharacter.add(t.charAt(i));
|
trackUniqueCharacter.add(t.charAt(i));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user