← 返回 google 的题目列表Array Transformation
类型:online_judge
Given two arrays A and B of the same length with unique elements, find a transformation that can transform A to B (find a one-to-one mapping of identical elements). Then, apply this transformation to another given array C and output the transformed array D. If there are duplicate elements in the array, how would you modify this? Ensure your code can handle the case with duplicates.
Example:
Input: A = [1, 2, 3] B = [4, 5, 6] C = [1, 3, 2]
Output: D = [4, 6, 5]
Example
Input
1 2 3
4 5 6
1 3 2