772. 只出现一次的字符 ---- 给你一个只包含小写字母的字符串。请你判断是否存在只在字符串中出现过一次的字符

莫浅子
发布
于
2022-11-18 16:26:08
发布
于
2022-11-18 16:26:08
#include <bits/stdc++.h>
using namespace std;
int cnt[26];
char str[100010];
int main()
cin>>str;
int len = strlen(str);
for(int i =0 ;i < len ;i++)
cnt[str[i]-'a']++;
for(int i= 0; i < len;i++)
if(cnt[str[i] - 'a'] == 1)