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.
- Prepare
- Algorithms
- Warmup
- Compare the Triplets
- Discussions
Compare the Triplets
Compare the Triplets
Sort by
recency
|
4346 Discussions
|
Please Login in order to post a comment
Here's my shortest answer (so far)…
Also short, but done without
for
loop…I'm not sure whether the
for
in a sequence comprehension is really considered to be the same as afor
-loop, but I thought I'd try to make a solution without that keyword anyway.Yesterday, I had submitted this longer answer because I was sleepy…
def maxx(a,b): if a==b: return 2 elif a>b: return 0 else: return 1 def compareTriplets(a, b): # Write your code here score=[0]*3 for i in range(0,len(a)): winner=maxx(a[i],b[i]) score[winner]+=1 score.pop() return score
Thanks for sharing the link! That was an interesting read—appreciate the detailed insights and the thoughtful discussion happening in the thread. Looking forward to more updates! महादेव बुक लॉगिन