Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. String Game Write a program that would take a string from STDIN and print to STDOUT number of unique words present in the string

image text in transcribed

image text in transcribed

3. String Game Write a program that would take a string from STDIN and print to STDOUT number of "unique" words present in the string (26 pts). The input read from STDIN will be a single line of text that can potentially contain letters, numbers, symbols, and spaces, but will not contain any newline characters. Each word in the input is separated by a comma. Ignore any Cases i.e. "Upper" and "upper" should be considered one Any non-alphanumerics shouldn't be ignored i.e. Dr's and Drs should be considered as different strings Make sure you are looking at Unique Strings only (.e. if Dr's is repeated twice, it should be counted only once) Running your program with no custom test cases will test it against the test cases your submission will be evaluated on. The basic test cases have visible output and targets so you can see where your program deviates from the desired result, while the more challenging cases are hidden. There are runtime limits on each case as well, so if your submission is not Running your program with no custom test cases will test it against the test cases your submission will be evaluated on. The basic test cases have visible output and targets so you can see where your program deviates from the desired result, while the more challenging cases are hidden. There are runtime limits on each case as well, so if your submission is not algorithmically efficient, you may see that some of the larger cases time out. It is not required to pass all the test cases to pass the question, but you should attempt to make as many as possible pass. 3. String Game Write a program that would take a string from STDIN and print to STDOUT number of "unique" words present in the string (26 pts). The input read from STDIN will be a single line of text that can potentially contain letters, numbers, symbols, and spaces, but will not contain any newline characters. Each word in the input is separated by a comma. Ignore any Cases i.e. "Upper" and "upper" should be considered one Any non-alphanumerics shouldn't be ignored i.e. Dr's and Drs should be considered as different strings Make sure you are looking at Unique Strings only (.e. if Dr's is repeated twice, it should be counted only once) Running your program with no custom test cases will test it against the test cases your submission will be evaluated on. The basic test cases have visible output and targets so you can see where your program deviates from the desired result, while the more challenging cases are hidden. There are runtime limits on each case as well, so if your submission is not Running your program with no custom test cases will test it against the test cases your submission will be evaluated on. The basic test cases have visible output and targets so you can see where your program deviates from the desired result, while the more challenging cases are hidden. There are runtime limits on each case as well, so if your submission is not algorithmically efficient, you may see that some of the larger cases time out. It is not required to pass all the test cases to pass the question, but you should attempt to make as many as possible pass

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

LO1 Discuss the objectives of human resource management.

Answered: 1 week ago