Providence Interview Question

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