Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- #define sz(s) int(s.size())
- typedef long long ll ;
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- }
- int main() {
- ABDEL3AL() ;
- int t ; cin >> t ;
- int freq[26] = {0} ;
- while (t--) {
- int cnt = 0 ;
- string s ; cin >> s ;
- for (int i = 0; i < sz(s); i++) freq[s[i] - 'a']++ ;
- for (int i = 0; i < 26; i++)
- if (freq[i]) cnt += min(freq[i] , 2) ;
- cout << cnt / 2 << "\n" ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment