Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer in python ACSL 2019-2020 Contest #2 AMERICAN COMPUTER SCIENCE LEAGUE Junior Division - ACSL String Differences PROBLEM: Given 2 strings with all capital letters,

Answer in pythonimage text in transcribed

ACSL 2019-2020 Contest #2 AMERICAN COMPUTER SCIENCE LEAGUE Junior Division - ACSL String Differences PROBLEM: Given 2 strings with all capital letters, eliminate characters using each of the rules below once until only different characters align. The rules are performed in the following order: Delete the second occurance of any double consonant. There will not be more than 2 of the same consonant together. Delete all vowels (A, E, I, O, U) unless the vowel is the first character in the string. Align the resulting strings from left to right. Then delete all like characters at like positions. Align the remaining characters from right to left. Then delete like characters at like positions starting from the end of the string. Example: MISSISSIPPI MISSOURI After removing the double consonants: MISISIPI MISOURI After removing the vowels: MSSP MSR After removing letters from L to R in same location: SP After removing letters from R to L in the same location (no changes): SP R Output: R INPUT: There will be 5 inputs. Each input will contain 2 strings separated by a single space and each fewer than 80 characters. OUTPUT: For each input, print the shorter of the two resulting strings or the first in alphabetical order if they have the same length. We guarantee that neither is an empty string. SAMPLE INPUT SAMPLE OUTPUT: http://www.datafiles.acsl.org/2020/contest2/jr-sample-input.txt MISSISSIPPI MISSOURI CATHERINE KATHERYNE CONSTITUTIONAL CONVENTIONAL COMPARTMENTALIZATION SEMIAUTOBIOGRAPHICAL PHYSICIAN PHARMACY 1. R 2. C. 3. VN 4. SBGRPHCL 5. RMY

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

6. Conclude with the same strength as in the introduction

Answered: 1 week ago

Question

7. Prepare an effective outline

Answered: 1 week ago