You are viewing a single comment's thread. Return to all comments →
function gamingArray(arr) { var maxInt = arr[0]; var counter = 1; if(arr.length === 1){ return "BOB"; } for(let i = 1; i < arr.length; i++){ if(arr[i] > maxInt){ maxInt = arr[i]; counter++ } } if(counter%2 === 0){ return "ANDY"; } else{ return "BOB" } }
Seems like cookies are disabled on this browser, please enable them to open this website
Gaming Array
You are viewing a single comment's thread. Return to all comments →
JavaScript solution