Tap here to switch tabs
Problem
Submissions

Problem: Find Anagram Mappings

med
30 min
Try to solve the Find Anagram Mappings problem.

Statement

You are given two integer arrays nums1 and nums2, where nums2 is an anagram of nums1. Both arrays have the same length.

An anagram mapping is an array mapping of indices such that nums1[i] == nums2[mapping[i]] for each index i.

Return an index mapping array mapping. If multiple valid mappings exist, return any of them.

Constraints:

  • 1≤1 \leq nums1.length ≤100\leq 100

  • nums2.length ==== nums1.length

  • 0≤0 \leq nums1[i], nums2[i] ≤105\leq 10^5

  • nums2 is an anagram of nums1.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Anagram Mappings

med
30 min
Try to solve the Find Anagram Mappings problem.

Statement

You are given two integer arrays nums1 and nums2, where nums2 is an anagram of nums1. Both arrays have the same length.

An anagram mapping is an array mapping of indices such that nums1[i] == nums2[mapping[i]] for each index i.

Return an index mapping array mapping. If multiple valid mappings exist, return any of them.

Constraints:

  • 1≤1 \leq nums1.length ≤100\leq 100

  • nums2.length ==== nums1.length

  • 0≤0 \leq nums1[i], nums2[i] ≤105\leq 10^5

  • nums2 is an anagram of nums1.