File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
lesson_13/maps_java/maps_app/src/main/java/com/codedifferently/lesson13 Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,17 @@ public class Lesson13 {
7
7
public int findPermutationDifference (String s , String t ) {
8
8
var charIndexMap = new HashMap <Character , Integer >();
9
9
10
- int totalDifference = 0 ;
10
+ int totalDifference = 0 ;
11
11
12
12
for (int sIndex = 0 ; sIndex < s .length (); sIndex ++) {
13
- charIndexMap .put (s .charAt (sIndex ), sIndex );
13
+ charIndexMap .put (s .charAt (sIndex ), sIndex );
14
14
}
15
15
16
16
for (int tIndex = 0 ; tIndex < t .length (); tIndex ++) {
17
- int indexInS = charIndexMap .get (t .charAt (tIndex ));
18
- totalDifference += Math .abs (indexInS - tIndex );
17
+ int indexInS = charIndexMap .get (t .charAt (tIndex ));
18
+ totalDifference += Math .abs (indexInS - tIndex );
19
19
}
20
-
20
+
21
21
return totalDifference ;
22
22
}
23
23
}
You can’t perform that action at this time.
0 commit comments