Skip to content

Commit 78976db

Browse files
author
Yafiaha
committed
Fix-up
1 parent 7395e13 commit 78976db

File tree

1 file changed

+3
-3
lines changed
  • lesson_13/maps_java/maps_app/src/main/java/com/codedifferently/lesson13

1 file changed

+3
-3
lines changed

lesson_13/maps_java/maps_app/src/main/java/com/codedifferently/lesson13/Lesson13.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ public class Lesson13 {
1010
*/
1111
public int findPermutationDifference(String s, String t) {
1212
HashMap<Character, Integer> hashMap = new HashMap<>();
13-
int pD = 0;
13+
int permutationD = 0;
1414
for (int i = 0; i < s.length(); i++) {
1515
hashMap.put(s.charAt(i), i);
1616
}
1717
for (char key : hashMap.keySet()) {
1818
int indexT = t.indexOf(Character.toString(key));
19-
pD += Math.abs(s.indexOf(key) - indexT);
19+
permutationD += Math.abs(s.indexOf(key) - indexT);
2020
}
21-
return pD;
21+
return permutationD;
2222
}
2323
}

0 commit comments

Comments
 (0)