Skip to content

Commit 4826646

Browse files
Changed method parameter names to "sourceString" and "targetString" for readability.
1 parent 5e06b15 commit 4826646

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/main/java/com/thealgorithms/strings/Isomorphic.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ private Isomorphic() {
2424
/**
2525
* Checks if two strings are isomorphic.
2626
*
27-
* @param s the first input string
28-
* @param t the second input string
29-
* @return {@code true} if {@code s} and {@code t} are isomorphic; {@code false} otherwise
27+
* @param sourceString the first input string
28+
* @param targetString the second input string
29+
* @return {@code true} if {@code sourceString} and {@code targetString} are isomorphic; {@code false} otherwise
3030
*/
31-
public static boolean areIsomorphic(String s, String t) {
32-
if (s.length() != t.length()) {
31+
public static boolean areIsomorphic(String sourceString, String targetString) {
32+
if (sourceString.length() != targetString.length()) {
3333
return false;
3434
}
3535

3636
Map<Character, Character> map = new HashMap<>();
3737
Set<Character> usedCharacters = new HashSet<>();
3838

39-
for (int i = 0; i < s.length(); i++) {
40-
char sourceChar = s.charAt(i);
41-
char targetChar = t.charAt(i);
39+
for (int i = 0; i < sourceString.length(); i++) {
40+
char sourceChar = sourceString.charAt(i);
41+
char targetChar = targetString.charAt(i);
4242

4343
if (map.containsKey(sourceChar)) {
4444
if (map.get(sourceChar) != targetChar) {

0 commit comments

Comments
 (0)