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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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