Given a string S , print the minimum number of characters you have to remove from the string S to make it a good string. A good string is a string in which all the characters are distinct.
First line contains test cases T
Second line of input contains a string S. S consists of lowercase characters only.
Print an integer denoting the minimum number of characters you have to remove from S to make it a good string for every test case.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.