Wiley interview question

Calculate the sum of an array