Find Combination Sum

Advanced

Let's join the exciting world of numbers with a fun challenge! Your task is to find if it's possible to pick some numbers from a list of positive integers such that they sum up to exactly a given number.

For this challenge, your mission is to implement a function named find_combination_sum that takes in a list of positive integers and an integer target. The function should return True if there is a combination of numbers in the list that sums up to the target; otherwise, it should return False.

Example:

  1. If you have a list [2, 3, 7, 1] and the target is 6, you can choose numbers like 3 and 3, or 2, 2, and 2 to sum up to 6. So the function should return True.

    find_combination_sum([2, 3, 7, 1], 6) # Output: True
  2. With the list [2, 4] and the target 5, no combination can sum up to 5.

    find_combination_sum([2, 4], 5) # Output: False
  3. For list [5] and target 5, you can pick 5 itself to match the target.

    find_combination_sum([5], 5) # Output: True

Are you ready to test your skills and logical reasoning? Happy coding!

Geek
Inputs

Arg 1:

[2,3,7,1]

Arg 2:

6
Expected Output
true
Actual Output
Find Combination Sum [advanced] | Coding for Kids