Compare the Triplets

Sort by

recency

|

4361 Discussions

|

  • + 0 comments

    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

  • + 0 comments

    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)

    }
    

    }

  • + 0 comments

    It's a concise and effective exercise for mastering comparison-based logic in programming. Ekbet86

  • + 0 comments
        compare = [a[i] - b[i] for i in range(len(a))]
        
        sumA = sum(1 for n in compare if n > 0)
        sumB = sum(1 for n in compare if n < 0)
        
        return sumA, sumB
    
  • + 0 comments

    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 ?