Tap here to switch tabs
Problem
Submissions

Problem: Find Anagram Mappings

Find Anagram Mappings gives two integer arrays with the same values in different orders. Return an index array that matches each value in the first array to an equal value in the second.

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

Find Anagram Mappings gives two integer arrays with the same values in different orders. Return an index array that matches each value in the first array to an equal value in the second.

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.