Skip to content

Latest commit

 

History

History
 
 

array-sum-pairs

Array-Sum-Pairs Challenge

In this challenge, you need to implement a function that receives an array of integers (both positive and negative) and returns the first pair of integers that add up to form a given sum.

As an example:

getPairs([3, 4, 7, 6], 10); // Must return [3, 7]

Notes

  • If no valid pair of integers can be found, return undefined
  • Your implementation must work for several different arrays of variadic length
  • Your implementation will also run against an array of 5.000.000 integers

Winner

  • The Winner will be the one that can submit the most performant version until Friday 2pm CET

Testing

  • Build your solution in index.js
  • Run npm install or yarn install
  • Run npm test or yarn test
  • No Errors? Go ahead and submit a Pull Request!