Answered step by step
Verified Expert Solution
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 python
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. RMYStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started