Providence interview question

Write a code to implement an array that is summed when equal to a given value?