Answers for "hackerrank compare the triplets python"

0

hackerrank compare the triplets

function compareTriplets(a, b) {
  let alice = 0
  let bob = 0
    
  for(let i = 0; i < 3; i++) {
       if(a[i] > b[i]) {
          alice += 1
       }
    
       if(a[i] < b[i]) {
          bob += 1
       }
      
       if(a[i] == b[i]) {
           continue
       }
  }
  
  return [alice, bob] // or String(alice).concat(String(bob)).split('')
}
Posted by: Guest on November-08-2021

Code answers related to "hackerrank compare the triplets python"

Code answers related to "Javascript"

Browse Popular Code Answers by Language