You are given an integer array nums.
Your task is to determine whether the sum of all elements in the array is even.
You may assume that:
0 (which is even).Return true if the sum is even, otherwise return false.
[2, 4, 6]
True
The sum is 2 + 4 + 6 = 12, which is even, so we return true.
[1, 2, 4]
False
The sum is 1 + 2 + 4 = 7, which is odd, so we return false.
[1, 3, 5, 1]
True
The sum is 1 + 3 + 5 + 1 = 10, which is even, so we return true.
[2, 4, 6]
True