Skip to content

Instantly share code, notes, and snippets.

@djanatyn
Forked from pritikadasgupta/compareTriplets.py
Created July 25, 2018 20:17
Show Gist options
  • Save djanatyn/71fad5115ecef6308262ab73d7359d20 to your computer and use it in GitHub Desktop.
Save djanatyn/71fad5115ecef6308262ab73d7359d20 to your computer and use it in GitHub Desktop.
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the compareTriplets function below.
def compareTriplets(a, b):
a_score=0
b_score=0
for i in range(0,len(a)):
if a[i] > b[i]:
a_score += 1
if a[i] < b[i]:
b_score += 1
return [a_score, b_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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment