C++ :
int simpleArraySum(vector<int> ar) {
/*
* Write your code here.
*/
int sum = 0;
for(int i = 0; i < ar.size(); i++){
sum += ar[i];
}
return sum;
}
Explanation:
Missed this all the way till the last warmup challenge. This is simple, simply adding up all the elements of a vector in sum, then returning it. Nothing much to say here, really.