Is there more to the question? What you’re being asked to do here is to look at the array, see which elements somewhere in the center interfere with summing to 10. You’re being asked to splice the array together, removing some elements from the middle of it.
The implied hint is the “middle of it” bit - so you will likely have the first and last thing remaining: [2, /* something */, 1]. Now, looking at the array, do you see a few consecutive values near one end or the other that sum to the remaining value?