Skip to content

Instantly share code, notes, and snippets.

@jordan-carlile
Created September 30, 2015 05:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordan-carlile/53f0b3ac78c1b466af74 to your computer and use it in GitHub Desktop.
Save jordan-carlile/53f0b3ac78c1b466af74 to your computer and use it in GitHub Desktop.
largest = 0;
result = [];
function largestOfFour(arr) {
for(i=0;i<arr.length;i++){
group = arr[i]
for(j=0;j<group.length;j++){
if(group[j] > largest){
largest = group[j];
}
}
result.push(largest);
largest=0;
}
return result;
}
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]], "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment