Created
December 23, 2015 06:48
-
-
Save obiPlabon/0243062053b4e8623915 to your computer and use it in GitHub Desktop.
Matrix plus diff
This file contains hidden or 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
| function matrixPlusDiff(m) { | |
| var d1 = d2 = 0; | |
| for(var i = 0, l = m.length; i < l; i++){ | |
| d1 += m[i][Math.floor(l/2)]; | |
| d2 += m[Math.floor(l/2)][i]; | |
| } | |
| console.log(d1-d2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment