-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUncommon Alphabets.py
More file actions
39 lines (28 loc) · 984 Bytes
/
Uncommon Alphabets.py
File metadata and controls
39 lines (28 loc) · 984 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
'''def unique_array(input1, input2):
total1 = 0
i = max(len(input1), len(input2))
if i == len(input1):
for element in input2:
if element in input1:
input1.remove(element)
for element in input1:
total1 += ord(element)
elif i == len(input2):
for element in input1:
if element in input2:
input2.remove(element)
for element in input2:
total1 += ord(element)
return (total1 - 1) % 9 + 1 if total1 > 0 else 0
print(unique_array(['A','B','C'], ['B','C','D']))
logical error'''
def unique_array(input1, input2):
i,total1 = 0,0
for element in input2:
if element in input1:
input1.remove(element)
for element in input1:
total1 += ord(element)
return (total1 - 1) % 9 + 1 if total1 > 0 else 0
print(unique_array(['A','B','C'], ['B','C']))
'''input2 should always be lesser to avoid errors'''