Question: PROBLEM STATEMENT | Write a function that takes a single input, a person's name, and returns a single output, a string array containing the two

PROBLEM STATEMENT|
Write a function that takes a single input, a person's name, and returns a single output, a string array containing the two possible favourite squishmallows.
The squishmallows should be taken from the list squishmallows.txt that is provided alongside this question. All squishmallows have names of the form x the Y, and you should return the full name.
To determine the favourite squishmallows you should consider each squishmallow as being named x the Y and then find the squishmallows who's Y part of the name is alphabetically nearest above, and nearest below, the name of the person provided.
So for example if the name is "lan" you should return ["Amaro the Hyena", "Glady the Ice Cream"], because "Husky" is alphabetically closest to lan below, and "Ice Cream" is alphabetically closest above.
Some squishmallows were removed from the list to avoid duplicate vocations, or if they did not have a name of the form x the Y. We also will not ask for names that are alphabetically before the first Y, or after the last.
Function *
1 whichSquishmallow("Ian")
 PROBLEM STATEMENT| Write a function that takes a single input, a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!