class Solution {
public:
vector<int> anagramMappings(vector<int>& A, vector<int>& B) {
unordered_map<int, int> map;
vector<int> res;
for (int i = 0; i<B.size(); i++) {
map[B[i]]=i;
}
for (int j = 0; j<A.size(); j++) {
res.push_back(map[A[j]]);
}
return res;
}
};
Find Anagram Mappings
Copyright © 2017 Powered by LZH, Theme used GitHub CSS.