-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCompareTheTriplets.py
More file actions
42 lines (31 loc) · 832 Bytes
/
Copy pathCompareTheTriplets.py
File metadata and controls
42 lines (31 loc) · 832 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
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'compareTriplets' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts following parameters:
# 1. INTEGER_ARRAY a
# 2. INTEGER_ARRAY b
#
def compareTriplets(a, b):
# Write your code here
alice_score = bob_score = 0
for alice, bob in zip(a, b):
if alice > bob:
alice_score += 1
elif alice < bob:
bob_score += 1
return [alice_score, bob_score]
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))
result = compareTriplets(a, b)
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()