Question: Integer inputSize is read from input. Then, strings and integers are read and stored into string vector itemList and integer vector numberList, respectively. Lastly, integer

Integer inputSize is read from input. Then, strings and integers are read and stored into string vector itemList and integer vector numberList, respectively. Lastly, integer numberThreshold is read from input.
Initialize lastFound with -1.
Find the last element pair with a number greater than or equal to numberThreshold. If the element pair is found, assign lastFound with the index of the element pair and output the item and number, separated by a space. End with a newline.
Ex: If the input is:
3
shoerack 93 chair 65 desk 84
82
Then the output is:
desk 84
Match found at # 2 C++

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!