fork download
  1. def Group(x):
  2. List=[]
  3. Sum=0
  4. for i in x:
  5. List.append(i)
  6. if len(set(List))==len(List):
  7. return True
  8. else:
  9. CopyList=List.copy()
  10. for i in set(List):
  11. CopyList.remove(i)
  12. for j in CopyList:
  13. if j*(List.count(j)) in x:
  14. Sum=0
  15. else:
  16. Sum+=1
  17. if Sum==0:
  18. return True
  19. N=int(input())
  20. Sum=0
  21. for i in range(N):
  22. S=input()
  23. if Group(S)==True:
  24. Sum+=1
  25. S=''
  26. print(Sum)
Success #stdin #stdout 0.02s 9416KB
stdin
1
abacc
stdout
1