Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define debug(n) cout<<(n)<<endl;
const ll INF = 2e18 + 99;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
unordered_set<char> uos;
for(char c : s){
uos.insert(c);
}
cout<<n+uos.size()<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
6
3
ABA
1
A
3
ORZ
5
BAAAA
4
BKPT
10
CODEFORCES
3
ABA
1
A
3
ORZ
5
BAAAA
4
BKPT
10
CODEFORCES
Output
5
2
6
7
8
17
2
6
7
8
17
Demonstration
Codeforcess Solution 1703-B B. ICPC Balloons ,C++, Java, Js and Python,1703-B,Codeforcess Solution