Program to display frequency of elements in list.
n = int(input())
l = list(map(int,input().split()))[:n]
i = 0
while i<len(l):
j = i+1
count=1
while j<len(l):
if l[i]==l[j]:
count+=1
l.pop(j)
j-=1
j+=1
print(l[i],"->",count)
i+=1
l = list(map(int,input().split()))[:n]
i = 0
while i<len(l):
j = i+1
count=1
while j<len(l):
if l[i]==l[j]:
count+=1
l.pop(j)
j-=1
j+=1
print(l[i],"->",count)
i+=1
Input
7
8 3 4 7 9 7 3
Output
8 -> 1
3 -> 2
4 -> 1
7 -> 2
9 -> 1
7
8 3 4 7 9 7 3
Output
8 -> 1
3 -> 2
4 -> 1
7 -> 2
9 -> 1