Hello - what is the correct procedure to find out if a given array of X size has a specific number in it or if the sum of any amount of the array numbers adds up to a specific number?

Say you have an array of [2, 6, 1, 4] and you want to find out if the number 6 is in the array or any sum of numbers adds up to 6.

So, both index 1 (which is a 6) is correct and index 0 + index 3 (which is 2 + 4) is correct.