Domanda di colloquio di Cyntexa

Array question involving positive and negative numbers. We had to process the array using an alternating sign pattern (+, -, +, -, ...). Example: Input: [10, -20, 30, -40, 50] Calculation: 10 - (-20) + 30 - (-40) + 50 Output: 150 (Note: This is a similar example based on my recollection. I don't remember the exact input/output given in the test.)