File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lesson_13/maps_java/maps_app/src/main/java/com/codedifferently/lesson13 Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,18 @@ public class Lesson13 {
9
9
* https://leetcode.com/problems/permutation-difference-between-two-strings
10
10
*/
11
11
public int findPermutationDifference (String s , String t ) {
12
- var charCountS = new HashMap <Character , Integer >();
12
+ var stringS = new HashMap <Character , Integer >();
13
13
14
14
int totalDifference = 0 ;
15
15
16
16
for (int sIndex = 0 ; sIndex < s .length (); sIndex ++) {
17
- charCountS .put (s .charAt (sIndex ), sIndex );
17
+ stringS .put (s .charAt (sIndex ), sIndex );
18
18
}
19
19
for (int tIndex = 0 ; tIndex < t .length (); tIndex ++) {
20
- int countIndexS = charCountS .put (t .charAt (tIndex ), tIndex );
20
+ int countIndexS = stringS .put (t .charAt (tIndex ), tIndex );
21
21
22
22
totalDifference += Math .abs (countIndexS - tIndex );
23
23
}
24
24
return totalDifference ;
25
25
}
26
- }
26
+ }
You can’t perform that action at this time.
0 commit comments