String Play (Deleted)
Submissions: 0   Accuracy:

0%

  Difficulty: Basic   Marks: 1

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.

Input:

First line contains test cases T
Second line of input contains a string S. S consists of lowercase characters only.

Output:
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.

Constraints:

1<=T<=10

 1≤|S|≤105

 

Sample Input:

2

aabc

aaabbbbccc

Sample Input:

1

7

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: raj79
Author: Striver


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.