Sum of All Fears

Given a list of numbers and a number K, return whether any two numbers from the list add up to K. Example: given [10, 15, 3, 7] and K of 17, return true since 10 + 7 is 17. The basic challenge is to write a program that uses a hard-coded array of [10, 15, 3, 7] and allows the user to enter a value for K before running the algorithm and returning true or false.


Challenge Description

  • Given a list of numbers and a number K, return whether any two numbers from the list add up to K. Example: given [10, 15, 3, 7] and K of 17, return true since 10 + 7 is 17. The basic challenge is to write a program that uses a hard-coded array of [10, 15, 3, 7] and allows the user to enter a value for K before running the algorithm and returning true or false.

Background

The Sum of all fears coding challenge is intended to assess a candidate’s ability to work with Arrays. This challenge or a slight variation has been used by technology companies such as Amazon and Google and was also featured as a Daily Coding Problem in dev.to.


Technologies Used for Sum of All Fears

HTML, JavaScript, jQuery, CSS, Bootstrap

Extra Credit

Allow the user to enter in their own values for both the Array and K before running the algorithm and returning true or false.