Created
March 31, 2017 10:27
-
-
Save fdjones/7fc35526b18acb2f1a969e9a9c337f88 to your computer and use it in GitHub Desktop.
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
var sum_pairs=function(ints, s){ | |
var newArr = []; | |
for (var k = 0; k < ints.length; k++) { | |
for (var n = k + 1; n < ints.length; n++) { | |
if (ints[k] + ints[n] == s) { | |
var final = newArr.push(ints[k], ints[n]); | |
return newArr; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment