Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 and

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions