← 返回 uber 的题目列表Compare Sum of Even and Odd Indexed Elements
类型:online_judge
uber
Given an integer array, compare the sum of elements at even indices with the sum of elements at odd indices. Return 'Even' if the sum at even indices is greater, 'Odd' if the sum at odd indices is greater, and 'Equal' if both are equal. For example, for the array [1, 3, 5, 7, 9], return 'Odd' because (1+5+9) < (3+7).
# Example test cases
# Input: [1, 2, 3, 4, 5]
# Output: 'Equal'
# Input: [10, 1, 7]
# Output: 'Even'
Data Limitations: Array length does not exceed 10000 and elements are integers.
Example
Input
[1, 2, 3, 4, 5]