1.Given two lists Aand B, and B is an anagram of A.
2.B is an anagram of A means B is made by randomizing the order of the elements in A.
3.We want to find an index mapping P, from A to B.
4.A mapping P[i] = j means the ith element in A appears in B at index j.
5.You have to complete anagramMappings() which should return the array P.
Input Format
1.First line contains an integer 'N' denoting the size of array. 2.Second line contains 'n' space separated elements of array A. 3.Third line contains 'n' space separated elements of array B.
Output Format
You have to return the array P.
Constraints
A, B have equal lengths in range [1, 100]. A[i], B[i] are integers in range [0, 10^5]
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
5 12 28 46 32 50 50 12 32 46 28
Output
1 4 3 2 0