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

Integer inputSize is read from input. Then, strings and integers are read and stored into string vector furnitureList and integer vector skuList, respectively. Lastly, integer skuThreshold is read from input.
Initialize lastFound with -1.
Find the last element pair with a sku greater than skuThreshold. If the element pair is found, assign lastFound with the index of the element pair and output the furniture and sku, separated by a space. End with a newline.
Ex: If the input is:
4
cradle 52 cubby 16 sofa 34 desk 17
33
Then the output is:
sofa 34
Found at # 2

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!