You are given an array A of size N where Ai is a positive integer at ith position.. Find out the maximum sum of the elements that can be obtained which is not even. If the sum can never be not even return 0
Task
Find out the maximum sum of the elements that are not even.
Example
N=5
A=[7,4,4,4,6]
Approach:
First, we find the sum of all the elements which in this case is 25. Since the sum is odd and we have to find the maximum sum that is not even, it is the final answer.
Function description
Complete the function solve provided in the editor. This function takes the following two-parameter and returns the required answer:
N: number of elements in the array.
A: a list containing positive integers.
Input Format:
The first line contains an integer T denoting the number of test cases
For each test case:
The first line contains the integer N, the size of the array A
The second line contains the N spaced positive integer values.
Output Format:
For each test case, print the answer in a new line.
Constraints:
1≤T≤101≤N≤1051≤Ai≤108
First we find sum of all the elements of the array which is 17. Since the sum is odd and we have to find the maximum sum that is not even it is the final answer