一、原题
原题链接 Odd or Even?
Instructions
Task:
Given a list of integers, determine whether the sum of its elements is odd or even.
Give your answer as a string matching "odd"
or "even"
.
If the input array is empty consider it as: [0]
(array with a zero).
Examples:
Input: [0] Input: [0, 1, 4] Input: [0, -1, -5] |
二、解题
1、读题
结合下面题中给出的测试用例, 可以知道,此题是将输入值求和,结果为基数返回“odd”,结果为偶数返回“even”。