Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c546906

Browse files
760. Find Anagram Mappings
1 parent 4f173a7 commit c546906

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎solution/0760.Find Anagram Mappings/README.md‎

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.*;
2+
3+
class Solution {
4+
public int[] anagramMappings(int[] A, int[] B) {
5+
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
6+
for (int i = 0; i < B.length; i++) {
7+
map.put(B[i], i);
8+
}
9+
int[] res = new int[B.length];
10+
int j = 0;
11+
for (int k : A) {
12+
res[j++] = map.get(k);
13+
}
14+
15+
return res;
16+
}
17+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /