-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path760.find-anagram-mappings.py
More file actions
57 lines (50 loc) · 1018 Bytes
/
760.find-anagram-mappings.py
File metadata and controls
57 lines (50 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# @leet imports start
from string import *
from re import *
from datetime import *
from collections import *
from heapq import *
from bisect import *
from copy import *
from math import *
from random import *
from statistics import *
from itertools import *
from functools import *
from operator import *
from io import *
from sys import *
from json import *
from builtins import *
import string
import re
import datetime
import collections
import heapq
import bisect
import copy
import math
import random
import statistics
import itertools
import functools
import operator
import io
import sys
import json
from typing import *
# @leet imports end
# @leet start
class Solution:
def anagramMappings(self, nums1: List[int], nums2: List[int]) -> List[int]:
numsList = {}
j = 0
for i in nums2:
if i not in numsList:
numsList[i] = j
j += 1
arr = []
for i in nums1:
arr.append(numsList[i])
return arr
# @leet end