We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defcompareTriplets(a,b):alicePoints=0#abobPoints=0#bcomparisonPoints=[]foriina:forjinb:# If each element of the list a and b, are greater than 1 and less than 100if(1<=i<=100)&(1<=j<=100):# We proceed to compare the points# If the index of the list a is equal to the index of the list bif(a.index(i)==b.index(j)):if(i>j):alicePoints+=1if(i<j):bobPoints+=1comparisonPoints.append(alicePoints)comparisonPoints.append(bobPoints)returncomparisonPoints
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Compare the Triplets
You are viewing a single comment's thread. Return to all comments →
I hope that my solution can help you: