For this Question: Given a string s, find the minimum number of changes required to it so that all substrings of the string become distinct.

Note: length of string is atmost 26.The first line contains an integer T, number of test cases. For each testcase there is only one line containing s atmost 26 characters.

1 <= T <= 100
1 <= |s| <= 26For each testcase in new line, print the minimum number of changes to the string.Sample Input:
3
aab
aebaecedabbee
ab

Sample Output:
1
8
0

Explanation:
Testcase 1: If we change one instance of 'a' to any character from 'c' to 'z', we get all distinct substrings.
Testcase 2: We need to change 2 a's, 2 b's and 4 e's to get distinct substrings.
Testcase 3: As no change is required hence 0., I have written this Solution Code: #include<bits/stdc++.h>
#define int         long long
#define ld          long double
#define ll          long long
#define pb          push_back
#define endl        '\n'
#define pi          pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define se          second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define dep(i,a,b)  for(int i=a;i>=b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

void solve(){
    string s;   cin >> s;
    int a[26] = {0};
    for(int i = 0; i < (int)s.length(); i++)
        a[s[i]-'a']++;
    int ans = 0;
    for(int i = 0; i < 26; i++){
        if(a[i])
            ans += (a[i]-1);
    }
    cout << ans << endl;
}

void testcases(){
    int tt = 1; 
    cin >> tt;
    while(tt--){
        solve();
    }
}


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

 		clock_t start = clock();
 	

    testcases();


 		cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms: ";
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?