Find Pair
Practice
2.5 (11 votes)
Basic programming
Open
Approved
Easy
Hash function
Mathamatics
Problem
69% Success 6417 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code
Given an array A having N elements. Find total number of pairs (i,j) such that j < i and Aj = Ai.
Input:
First line of input contains N, size of array A. Next line contains N space separated elements of array A.
Output:
Print the required answer.
Constraints:
1 ≤ N ≤ 105
0 ≤ Ai ≤ 105
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Submissions
Please login to view your submissions
Similar Problems
Points:20
7 votes
Tags:
SortingBasic ProgrammingEasyMathematicsOpenApprovedMathamatics
Points:20
Tags:
Basic Math
Points:20
25 votes
Tags:
Binary SearchMath BasicAlgorithmsBasic MathMath
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor