1
2function crossAdd(input) {
3 var answer = [];
4 for (var i = 0; i < input.length; i++) {
5 var goingUp = input[i];
6 var goingDown = input[input.length-1-i];
7 answer.push(goingUp + goingDown);
8 }
9 return answer;
10}
11// O(N) time complexity
12
13