-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path!!!Numeric String Template.py
More file actions
29 lines (29 loc) · 1 KB
/
!!!Numeric String Template.py
File metadata and controls
29 lines (29 loc) · 1 KB
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
# check matches the template or not
# def check_match (arr, tm):
# if len(arr) != len(tm):
# return "NO"
# else:
# # grouping duplicate word's value by following the list 'arr'
# positions = {}
# for index, character in enumerate(tm):
# if character not in positions:
# # adding value in a set
# positions[character] = {arr[index]}
# else:
# positions[character].add(arr[index])
# # checking if any of set's length greater than 1 or not
# for k in positions:
# if len(positions[k]) > 1:
# return "NO"
# return "YES"
#
#
# # Main code starts here
# test_cases = int(input())
# for i in range(test_cases):
# array_length = int(input())
# array_elements = list(map(int, input().split()))
# template_test_cases = int(input())
# for j in range(template_test_cases):
# template = input()
# print(check_match(array_elements, template))