Created
September 30, 2015 05:06
-
-
Save jordan-carlile/53f0b3ac78c1b466af74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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