Question: Queue Lab The store manager decided to giveaway Giants and Jets t - shirts to their customers since they were shutting down the business. People
Queue Lab
The store manager decided to giveaway "Giants" and "Jets" tshirts to their customers since they were shutting down the business. People supporting their team had to carry a sign that says whether they are "Giants" fan of "Jets". Store manager has no other employee to help him out and had all the tshirts piled up in one single pile. So he came up with his own rule. The rule is simple: If customer in a queue is carrying sign that says "Giant" AND shirt on the pile is "Giants" shirt or if customer in a queue is carrying sign that says "Jets" AND shirt on the pile is "Jets" shirt then customer takes the shirt and leave the queue otherwise customer joins back queue at the end of the line. This continues until none of the queue customer want to take the top shirt or there are no more tshirts left. You need to design you program to find out how many customer will end up getting no shirts.
Example Input and output:
Inputtwo arrays of String: customers shirts
Outputinteger :
Step by step process for sample inputoutput:
tableOperationtabletshirtfrontendtableCustomerfrontendExplanationtablecomparenew statetable
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
