Test case a single line comprising the passages

Assignment Help Computer Engineering
Reference no: EM132107932

Programming Challenge Description:

You will be given a sequence of passages, and must filter out any passage whose text (sequence of whitespace-delimited words) is wholly contained as a sub-passage of one or more of the other passages.

When comparing for containment, certain rules must be followed:

-The case of alphabetic characters should be ignored

-Leading and trailing whitespace should be ignored

-Any other block of contiguous whitespace should be treated as a single space

-non-alphanumeric character should be ignored, white space should be retained

Duplicates must also be filtered - if two passages are considered equal with respect to the comparison rules listed above, only the shortest should be retained.

If they are also the same length, the earlier one in the input sequence should be kept. The retained passages should be output in their original form (identical to the input passage), and in the same order.

Input:

For each test case a single line comprising the passages (strings) to be processed, delimited by | characters. The | characters are not considered part of any passage.

Output:

A single line of filtered passages in the same |-delimited format.

Test 1

Test Input

Download Test Input

IBM cognitive computing|IBM "cognitive" computing is a revolution| ibm cognitive computing|'IBM Cognitive Computing' is a revolution?
Expected Output

Download Test Output

IBM "cognitive" computing is a revolution
Test 2

Test Input

Download Test Input

"Computer Science Department"|Computer-Science-Department|the "computer science department"
Expected Output

Download Test Output

Computer-Science-Department|the "computer science department"

Reference no: EM132107932

Questions Cloud

Write a program that hints the user to input a different num : Write a program that hints the user to input a different number each time repetitively (both integer and float numbers are acceptable).
What is the present value of the offer : What is the present value of the offer if the discount rate is 10 percent?
Write a program to load the names in the combo box : Create an SQL or Access database with all your friends' information and write a program to load the names in the combo box.
Present value of the cash flows : What is the present value of the cash flows from your lottery winnings?
Test case a single line comprising the passages : IBM cognitive computing|IBM "cognitive" computing is a revolution| ibm cognitive computing|'IBM Cognitive Computing' is a revolution?
What is the modified duration of portfolio : The term structure is flat, and all spot rates are 3%. What is the modified duration of your portfolio?
Accept input from the user and verify that they have entered : Accept input from the user and verify that they have entered a 16 bit binary number (note: you'll need to handle binary numbers as strings)
What interest rate would you expect to pay on the issue : If the 10 year maturity premium is 0.4%, what interest rate would you expect to pay on the issue?
Create an array of pointers to cards that are in the correct : In this problem you will shuffle a deck of cards where each card is represented by a twocharacter string.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Percent of commission

What is Tom's base salary? What percent of commission does he earn? Would you be able to use the same equation for Tom for the next year? Why or Why not?

  Sense making in health care organizations

Evaluate the most suitable way that the “sense making” may be applied to the health care organizations. Give the specific examples in order to support your response.

  Your have been contracted by healthfirst hospital

your have been contracted by healthfirst hospital foundation hhf a charitable organization that provides services to

  What kind of problems does regularization solve

What is regularization, and what kind of problems with machine learning does it solve? Give decision trees to represent the given Boolean functions.

  Discuss the implications for the last part of problem

Consider fully developed laminar flow of a constant-property fluid in a circular tube. At a particular flow cross section calculate the total axial momentum.

  Determine the objects needed for the design

It is used to identify and determine the objects needed for the design. Polymorphism is the ability for classes to provide different implementations of methods.

  How many cars in every team called chevy and ford

How many cars in every team called Chevy and Ford There are eight cars in every team called Chevy and Ford. One car from each team races its opponent on drag strip.

  Give example for twos complement

Show by example that two's-complement overflow cannot occur when numbers of opposite sign are added.

  Write an echo server using udp

Write an 'echo' client to test your server. Each client will send 20 sequentially numbered messages to the server & receive the replies. \

  Why was macintosh a turning point in multimedia computing

IT441: Why was the Macintosh a turning point in multimedia computing? Why was Tim Berners-lee's development of the World Wide Web significant in the evolution of multimedia?

  Examine the technical merits and demerits of using a

a hypervisor is computer hardware platform virtualization software that allows multiple different operating systems os

  How technology impacts the given ethics topic

Hhow this computer ethic is developed or derived? How technology impacts this ethics topic and how the topic impacts technology?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd