Question: Create a function unique_letters that returns the number of unique letters in an input string. The input to your function is the string S. You
Create a function unique_letters that returns the number of unique letters in an input string. The input to your function is the string S. You can assume this function is not case sensitive. For example, for the input string "abracadabra" the returning value is 5 as there remain five letters "abrcd" after filtering out repeated values.
The function name and parameters are as follows: unsigned int unique_letters(const char *S);
Must be written in C++ and only include #include
I only need the function because I'm submitting it to an autograder so if you want to write a name to test the function some test cases are
Problem 8
- S = "xxXXXXxxxCCCCxxxx??ZZZZZxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (return 3)
- S = "12345////}}{}{" (return 0)
- S = "aaaaaa" (return 1)
- S = "a" (return 1)
- S = "/" (return 0)
- S = "ZZZZZZZZzzzzZZZZzzzAAAAaaaA12" (return 2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
