Skip to content

Commit 1946fef

Browse files
authored
Improved task 2121.
1 parent 65e071a commit 1946fef

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/g2101_2200/s2121_intervals_between_identical_elements

1 file changed

+4
-4
lines changed

src/main/java/g2101_2200/s2121_intervals_between_identical_elements/Solution.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
import java.util.Map;
1010

1111
public class Solution {
12-
public long[] getDistances(int[] a) {
13-
int n = a.length;
12+
public long[] getDistances(int[] arr) {
13+
int n = arr.length;
1414
Map<Integer, List<Integer>> map = new HashMap<>();
1515
for (int i = 0; i < n; i++) {
16-
List<Integer> list = map.get(a[i]);
16+
List<Integer> list = map.get(arr[i]);
1717
if (list == null) {
1818
list = new ArrayList<>();
1919
}
2020
list.add(i);
21-
map.put(a[i], list);
21+
map.put(arr[i], list);
2222
}
2323
long[] ans = new long[n];
2424
Arrays.fill(ans, 0);

0 commit comments

Comments
 (0)