Inverter um array

Published by SyntaxGardener in

Retorne um array com o sinal de cada número invertido.

Exemplos

Program.InvertArray(new[] { 1, 2, 3, 4, 5 }) ➞ new[] { -1, -2, -3, -4, -5 }

Program.InvertArray(new[] { 1, -2, 3, -4, 5 }) ➞ new[] { -1, 2, -3, 4, -5 }

Program.InvertArray(new int[0]) ➞ new int[0]