Shubham and Xor
Tag(s):

## Algorithms, Bubble sort algorithm, Easy, Linear search, Searching algorithm, Sorting

Problem
Editorial
Analytics

You are given an array of n integer numbers $a_1$, $a_2$, .. ,$a_n$. Calculate the number of pair of indices $(i,j)$ such that $1\le i$ < $j\le n$ and $a_i$ xor $a_j = 0$

Input format
- First line: n denoting the number of array elements
- Second line: n space separated integers $a_1$, $a_2$, .. ,$a_n$.

Output format
Output the required number of pairs.

Constraints
$1\le n\le 10^6$
$1 \le a_i \le 10^9$

SAMPLE INPUT
5
1 3 1 4 3

SAMPLE OUTPUT
2

Explanation

The 2 pair of indices are $(1,3)$ and $(2,5)$ .

Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

## CODE EDITOR

Initializing Code Editor...

## This Problem was Asked in

Challenge Name

January Easy '18

OTHER PROBLEMS OF THIS CHALLENGE
• Data Structures > Hash Tables
• Data Structures > Advanced Data Structures
• Algorithms > Dynamic Programming
• Algorithms > Dynamic Programming

?