Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Write a function that takes in a targetSum and an array of numbers as arguments.

The function should return an array of the shortest combination of numbers that add up to exactly the targetSum.

If there is a tie for the shortest combination, you may return any one of the shortest.

eg targetSum = 7, array = [2, 3, 4] solutions: [4, 3] or [3, 4]