Last active
April 6, 2020 11:22
-
-
Save RabeyaMuna/8bcabcd7fa1035000ad3a60bf4be14a1 to your computer and use it in GitHub Desktop.
Python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the compareTriplets function below. | |
def compareTriplets(a, b): | |
c=0 | |
d=0 | |
for i in range (0,len(a)): | |
if a[i]>b[i]: | |
c+=1 | |
elif b[i]>a[i]: | |
d+=1 | |
return str(c) +""+str(d) | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment