DEV Community

Discussion on: Daily Challenge #63- Two Sum

Collapse
 
chrisachard profile image
Chris Achard

The target example is given as:

twoSum [1, 2, 3] 4 === (0, 2)

But I believe that should be something like:

twoSum [1, 2, 3] 4 === (1, 3)

correct?

Collapse
 
savagepixie profile image
SavagePixie

No, because it returns the indices, not the values.

The indices of these items should then be returned in a tuple like so: (index1, index2).

Collapse
 
chrisachard profile image
Chris Achard

OH! missed that :) Thanks!