A data compression software utilities various steps to compress a string of data one of the steps involves find the count of the character that are not repeated in the string
#include <stdio.h>
int main() {
char *str;
scanf("%s", str);
int chars[128];
for (int i = 0; i < sizeof(str)/sizeof(str[i]); i++)
chars[i]++;
int res = 0;
for (int i = 'a'; i <= 'z'; i++)
if (chars[i] == 1)
res++;
printf("%d", res);
return 0;
}
Comments
Leave a comment