Skip to content

Instantly share code, notes, and snippets.

@dmidlo
Last active November 23, 2015 00:39
Show Gist options
  • Save dmidlo/d23d60087b3f97224cfc to your computer and use it in GitHub Desktop.
Save dmidlo/d23d60087b3f97224cfc to your computer and use it in GitHub Desktop.
function largestNumberOfArray(arr) {
var resultArray = [];
for(var i = 0; i < arr.length; i++)
{
resultArray.push(arr[i][0]);
for(var ii = 0; ii < arr[i].length; ii++)
{
if(arr[i][ii] > resultArray[i])
{
resultArray[i] = arr[i][ii];
}
}
}
return (resultArray);
}
largestNumberOfArray([[4, 5, 1, 3], [13, 27, 18, 26], [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