Can anybody tell me how to implement a program to check a string contains all unique chars ?
I hope this can help you
#include using namespace std; int main() { string s; cin>>s; int a[256]={0}; int sum=0; for (int i = 0; i < s.length();i++){ if(a[s[i]]==0)++sum; a[s[i]]+=1; } cout<<(sum==s.length()?"yes":"no"); return 0;
}