Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Algorithms

Find the combos

Instructions

Given an array of numbers and a single number, each as a separate argument, create a function which returns two indices within the array that point to values whose sum equals the second argument, or the target number.

If there are multiple values whose sum equals the target, that is ok. We only need to return two of the values.

Example

Given the following two variables: var array = [3,5,12,4,19,1,18]; var target = 22;

Our function should return any of the four following values: [0,4], [4,0], [3,6], or [6,3]

Remeber, we are returning the INDICES of the values, not the values themselves