Skip to content

Instantly share code, notes, and snippets.

@ghorvat
Created November 13, 2015 20:39
Show Gist options
  • Save ghorvat/aab87c3c83b3ac9bbd6a to your computer and use it in GitHub Desktop.
Save ghorvat/aab87c3c83b3ac9bbd6a to your computer and use it in GitHub Desktop.
demo
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