1
class Solution {
2
public int[] arrayChange(int[] nums, int[][] operations) {
3
Map<Integer, Integer> map = new HashMap<>();
4
for (int i = 0; i < nums.length; i++) map.put(nums[i], i);
5
for (int[] op : operations) {
6
nums[map.get(op[0])] = op[1];
7
map.put(op[1], map.get(op[0]));
8
map.remove(op[0]);
9
}
10
return nums;
11
}
12
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0