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
|
4361 Discussions
|
Please Login in order to post a comment
my approch def compareTriplets(a, b): count1 = 0 count2 = 0 for i in range(3): if a[i] > b[i]: count1+=1 elif a[i] < b[i]: count2+=1 return count1, count2
public static List compareTriplets(List a, List b) { Listres=new ArrayList<>(); int alice=0,bob=0; for(int i=0;ib.get(i)) alice++; else if(a.get(i)
}
It's a concise and effective exercise for mastering comparison-based logic in programming. Ekbet86
What should I do when an input constraint is met ? For example if one of Alice's input scores is >100, should I just not give a point to either in this case ?