Created
November 13, 2015 20:39
-
-
Save ghorvat/aab87c3c83b3ac9bbd6a to your computer and use it in GitHub Desktop.
demo
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 demo ( A ) { | |
var count = A.length, | |
counter = [0,0], | |
equis = []; | |
while(count--){ | |
counter[1] += A[count]; | |
} | |
count = A.length; | |
while(count--) { | |
counter[0] += A[count]; | |
if (counter[0] == counter[1]) { | |
equis.push(count); | |
} | |
counter[1] -= A[count]; | |
} | |
var int = (equis.length)?equis:-1; | |
for(i = 0; i<int.length; i++) { | |
return int[i]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment