Find Anagram Mappings
Given two lists A
and B
, and B
is an anagram of A
. B
is an anagram of A
means B
is made by randomizing the order of the elements in A
.
We want to find an index mapping P
, from A
to B
. A
mapping P[i] = j
means the ith
element in A
appears in B
at index j
.
These lists A
and B
may contain duplicates. If there are multiple answers, output any of them.
A, B
have equal lengths in range[1, 100]
.A[i]
,B[i]
are integers in range[0, 10^5]
.
Example
Example1
Example2
PreviousPairs of Non Coinciding PointsNextSmallest subarray with all occurrences of a most frequent element
Last updated