File tree Expand file tree Collapse file tree
src/main/java/com/thealgorithms/strings Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments