You are given an integer array nums consisting of distinct positive integers, and a operations where operations[i] = [oldValue, newValue].
You need to apply all operations in sequence. For each operation operations[i], replace the element in nums that has the value operations[i][0] with the value operations[i][1].
Return the array nums after performing all operations.
Constraints:
n nums.length
m operations.length
n, m
All the values of nums are distinct.
operations[i].length
nums[i], operations[i][0], operations[i][1]
operations[i][0] will exist in nums when applying the
operations[i][1] will not exist in nums when applying the
You are given an integer array nums consisting of distinct positive integers, and a operations where operations[i] = [oldValue, newValue].
You need to apply all operations in sequence. For each operation operations[i], replace the element in nums that has the value operations[i][0] with the value operations[i][1].
Return the array nums after performing all operations.
Constraints:
n nums.length
m operations.length
n, m
All the values of nums are distinct.
operations[i].length
nums[i], operations[i][0], operations[i][1]
operations[i][0] will exist in nums when applying the
operations[i][1] will not exist in nums when applying the