Skip to content

refactor: fix typo #5372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*
* @author AKS1996
*/
public final class GuassLegendre {
private GuassLegendre() {
public final class GaussLegendre {
private GaussLegendre() {
}

public static void main(String[] args) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/thealgorithms/strings/Isomorphic.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ public static boolean checkStrings(String s, String t) {
// To mark the characters of string using MAP
// character of first string as KEY and another as VALUE
// now check occurence by keeping the track with SET data structure
Map<Character, Character> characterMap = new HashMap<Character, Character>();
Set<Character> trackUinqueCharacter = new HashSet<Character>();
Map<Character, Character> characterMap = new HashMap<>();
Set<Character> trackUniqueCharacter = new HashSet<>();

for (int i = 0; i < s.length(); i++) {
if (characterMap.containsKey(s.charAt(i))) {
if (t.charAt(i) != characterMap.get(s.charAt(i))) {
return false;
}
} else {
if (trackUinqueCharacter.contains(t.charAt(i))) {
if (trackUniqueCharacter.contains(t.charAt(i))) {
return false;
}

characterMap.put(s.charAt(i), t.charAt(i));
}
trackUinqueCharacter.add(t.charAt(i));
trackUniqueCharacter.add(t.charAt(i));
}
return true;
}
Expand Down