For this Question: Given an array of N elements, your task is to find the count of repeated elements. Print the repeated elements in ascending order along with their frequency.
Have a look at the example for more understanding.The first line of input contains a single integer N, the next line of input contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= N <= 100000
1 <= Arr[i] <= 100000For each duplicate element in sorted order in a new line, First, print the duplicate element and then print its number of occurence space- separated.

Note:- It is guaranteed that at least one duplicate element will exist in the given array.Sample Input:-
5
3 2 1 1 2

Sample Output:-
1 2
2 2

Sample Input:-
5
1 1 1 1 5

Sample Output:-
1 4

Explaination:
test 1: Only 1 and 2 are repeated. Both are repeated twice. So, we print:
1 -> frequency of 1
2 -> frequency of 2
1 is printed before 2 as it is smaller than 2, I have written this Solution Code: import numpy as np
from collections import defaultdict

n=int(input())
a=np.array([input().strip().split()],int).flatten()
d=defaultdict(int)
for i in a:
  d[i]+=1
d=sorted(d.items())
for i in d:
  if(i[1]>1):
    print(i[0],end=" ")
    print(i[1])

, In this Programming Language: Python, Now tell me if this Code is compilable or not?