(RankList for this Question)
Some people hate growing up into adults. (Some believe that with great power i.e age, comes great responsibility and hence they hate the extra burden).
The question is can we find these humans who hate evolution into adults? The almighty God has derived a random algorithm, which is completely wrong, but since he's everyone’s parent, you've to humor him and his crazy algorithm.
He thinks if you are given N humans in an array, A1,A2 ... AN, where each human is denoted by an integer. The total unique pairs in total, each given by (Ai,Aj) where j > i, is the number of humans who hate growing up.
1 ≤ N ≤ 2 * 10^5
1 ≤ Ai ≤ 10^9
The first line will consist of a single integer N denoting no of humans. The second line consists of N integers A1,A2 ... AN.
Output the total number of unique pairs (Ai,Aj) that can be formed, which will also be the number of special Pikachus.
1 2 2 1 3
All possible pair combinations are (1,1),(1,2) , (1,3) , (2,1), (2,2), (2,3).
Log In to solve the Question