Skip to content

Instantly share code, notes, and snippets.

View minhluan2292's full-sized avatar
Work hard

Luan Huynh minhluan2292

Work hard
View GitHub Profile
function calculatorScore(A, B) {
if(A.length != B.length) return 'Length error';
let scoreA = scoreB = 0;
A.forEach((value, index) => {
if(value > B[index]) scoreA++;
if(value < B[index]) scoreB++;
});
return `[${scoreA},${scoreB}]`;
}