You Want Chocolate?

Bear Limak is very much fond of chocolate. His mom wants her son to study hard and develop his skill…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

What is the problem?
Why getting WA on 2nd test case???

for x in range(int(input())):
    n=int(input())
    s=input()
    l=set()
    if s=='':
        print(-1)
        continue
    print("Case %d:"%(x+1))
    for y in s:
    	l.add(y)
    l=sorted(l)
    for y in l:
        if y not in [' ','!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']:
            print("%s - %s"%(y,s.count(y)))
    print()