forked from adityabisoi/ds-algo-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solution.py
41 lines (29 loc) · 975 Bytes
/
solution.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
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the compareTriplets function below.
def compareTriplets(a, b):
n1 = 0 # point counter for Alice
n2 = 0 # point counter for Bob
l=[] # list that contains the total point
for i in range(len(a)): #Loop for accesing the values of a and b
if(a[i] < b[i]):
n2+=1
elif(a[i]>b[i]):
n1+=1
else:
pass
l.append(n1) #appending the list with counter variables
l.append(n2)
return(l) #returning the list
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
a = list(map(int, input().rstrip().split())) #input for Alice
b = list(map(int, input().rstrip().split())) #input for Bob
result = compareTriplets(a, b) #calling the function for comparision
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()