Answers for "compare triplets hackerrank solution in javascritp"

1

compare the triplets hackerrank solution in javascript

var result = [];
var aScore = 0,
    bScore = 0;

for (var i = 0; i < a.length; i++) {
    if (a[i] > b[i]) aScore++;
    if (a[i] < b[i]) bScore++;
}
result[0] = aScore;
result[1] = bScore;
return result;
Posted by: Guest on July-02-2020

Code answers related to "compare triplets hackerrank solution in javascritp"

Code answers related to "Javascript"

Browse Popular Code Answers by Language