Skip to content

Instantly share code, notes, and snippets.

@MacTanomsup
Created November 17, 2018 06:13
Show Gist options
  • Select an option

  • Save MacTanomsup/5a32bc369df6f8ea9c1a868f02b7a5e1 to your computer and use it in GitHub Desktop.

Select an option

Save MacTanomsup/5a32bc369df6f8ea9c1a868f02b7a5e1 to your computer and use it in GitHub Desktop.
function sumZero(arr){
for(let i = 0; i < arr.length; i++){
for(let j = i+1; j < arr.length; j++){
if(arr[i] + arr[j] === 0){
return [arr[i], arr[j]];
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment