Skip to content

Instantly share code, notes, and snippets.

@johnbahamon
Last active December 6, 2016 13:49
Show Gist options
  • Save johnbahamon/0410d72b928dc23b493676def01d1185 to your computer and use it in GitHub Desktop.
Save johnbahamon/0410d72b928dc23b493676def01d1185 to your computer and use it in GitHub Desktop.
function sumMatrix(matrix: number[][]) {
var sum = 0;
for (var i = 0; i < matrix.length; i++) {
var currentRow = matrix[i];
for (var i = 0; i < currentRow.length; i++) {
sum += currentRow[i];
}
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment