Question: XOR of Sums Coding ( 6 ) UNSOLVED Problem Statement Ravi is playing a game in which he needs to convert an array into an

XOR of Sums
Coding
(6) UNSOLVED
Problem Statement
Ravi is playing a game in which he needs to convert an array into an integer. This task seems to be impossible, but Ravi has an-algorithm to carry out this conversion.
Take the sum of odd-indexed elements
Take the sum of even indexed elements
Take the XOR of both sums
This is how Ravi converts the array into an integer. Write a program to carry this task out for Ravi,
Input Format
The first line of input contains an integer N
Next N lines of input contain an integer each, the elements of the array.
Constraints
1N105
1A[i]109
Output Format
Print a single integer, the answer to the problem.
Evaluation Parameters
Sample Input
5
1
2
 XOR of Sums Coding (6) UNSOLVED Problem Statement Ravi is playing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!