Answer to Question #269586 in C for Keerthi

Question #269586

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




1
Expert's answer
2021-11-22T09:35:20-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS