Summation of integers

0

0 votes
, Data type, Easy., Basic Programming
Problem

You are given an array A of N integers. Your task is to print the sum of numbers that occurs for an even number of times in the array.

Input format

  • First line: A single integer N
  • Second line: N space-separated integers denoting array A

Output format

Print a single integer denoting the sum of numbers that appeared for even times in the array.

Constraints

1N1051Ai109

 

Edited problem statement

You are given an array A of N integers. Your task is to print the sum of numbers that is occurring for an even number of times in the array.

Input format

  • The first line of the input contains a single integer N denoting the number of integers or elements in the array.
  • The second line of the input contains N space-separated integers denoting the elements of array A.

Output format

Print a single integer denoting the sum of numbers that appeared for the even number of times in the array.

Constraints

1N1051Ai109

Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

Here the numbers 2 and 1 appears twice. Hence, the answer will be 2+1=3.

Editor Image

?