Help me in solving AO07 problem

My issue

i’m not able to understand the code after the sorting part. can someone explain?

My code

# Update the '_' in the code below to solve the problem

t = int(input())
for i in range(t):
    N = int(input())
    A = list(map(int, input().split()))
    unique = []
    freq = []
    # set() returns the unique elements in a list
    unique = list(set(A))       
    # sort the list unique in an ascending order
    for i in unique:
        # count() returns the count of an element in a list
    # print(*list) returns only the values

Learning course: Python for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone