Skip to content

Commit 4e0fee1

Browse files
author
jjcapparell
committed
chore: removed unnecessary lines of code for java and ts file
1 parent 1ebdea8 commit 4e0fee1

File tree

1 file changed

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

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ public int findPermutationDifference(String s, String t) {
1313
stringT.put(t.charAt(i), i);
1414
}
1515
for (Character key : stringS.keySet()) {
16-
if (stringT.containsKey(key)) {
17-
int value1 = stringS.get(key);
18-
int value2 = stringT.get(key);
19-
int difference = Math.abs(value1 - value2);
20-
diffSum += difference;
21-
}
16+
int value1 = stringS.get(key);
17+
int value2 = stringT.get(key);
18+
int difference = Math.abs(value1 - value2);
19+
diffSum += difference;
2220
}
2321
return diffSum;
2422
}

0 commit comments

Comments
 (0)