Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
const int MAX = 1000;
char d, c[MAX];
int i = 0;
while(d != '}'){
cin>>d;
if(d >= 97 && d <= 122){
c[i] = d;
i++;
}
}
c[i] = '\0';
sort(c, c+i);
char h = 'A';
int count = 0;
for(int j = 0; j < i; j++){
if(c[j] != h){
count++;
h = c[j];
}
}
cout<<count;
}
Copy The Code &
Try With Live Editor
Input
{a, b, c}
Output
3
Demonstration
Codeforcess Solution 443-A A. Anton and Letters ,C++, Java, Js and Python , 443-A,Codeforcess Solution