-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCount_Triplets
More file actions
34 lines (25 loc) · 740 Bytes
/
Count_Triplets
File metadata and controls
34 lines (25 loc) · 740 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
#!/bin/python3
import math
import os
Question: https://www.hackerrank.com/challenges/compare-the-triplets/problem
import random
import re
import sys
# Complete the compareTriplets function below.
def compareTriplets(a, b):
alice_collective=0
bob_collective=0
for x in range(3):
if a[x]>b[x]:
alice_collective+=1
elif a[x]<b[x]:
bob_collective+=1
return alice_collective, bob_collective
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()