forked from kilian-hu/hackerrank-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstub.py
48 lines (33 loc) · 900 Bytes
/
stub.py
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
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'stringAnagram' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts following parameters:
# 1. STRING_ARRAY dictionary
# 2. STRING_ARRAY query
#
def stringAnagram(dictionary, query):
# Write your code here
pass
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
dictionary_count = int(input().strip())
dictionary = []
for _ in range(dictionary_count):
dictionary_item = input()
dictionary.append(dictionary_item)
query_count = int(input().strip())
query = []
for _ in range(query_count):
query_item = input()
query.append(query_item)
result = stringAnagram(dictionary, query)
fptr.write('\n'.join(map(str, result)))
fptr.write('\n')
fptr.close()