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