CHEFRECP, please tell me what is wrong with my code

Please format your complete code or provide the link of your solution.

Now please check

Say n = 1, you are directly printing “YES” rather than taking the input of recipes. What happens to this unused input? It goes to the next test case. This messes up the input of your program.

I didn’t get where I am wrong

from itertools import groupby
for i in range(int(input())):
    n = int(input())
    c = 0
    a = list(map(int, input().split()))
    g = sorted(a)
    b = [len(list(group)) for key, group in groupby(a)]
    h = [len(list(group)) for key, group in groupby(g)]
    b = sorted(b)
    h = sorted(h)
    if(b == h):
        #b = sorted(b)
        d = [len(list(group)) for key, group in groupby(b)]
        #for i in range(len(b)-1):
     #       if(b[i] == b[i+1]):
      #          c = 0
           # else:
        #     c = 1
        for i in d:
            if(i > 1):
                c = 1
        if(c == 1):

Please provide some testcases

MY updated code, please help me to find where i am wrong. Please tell me Just one test case where my solution fail.