Question: Bakery Quality Control This coding exercise is worth a total of 1 0 points, each test is worth one point. Your program controls boxes of
Bakery Quality Control
This coding exercise is worth a total of points, each test is worth one point.
Your program controls boxes of pastries coming out of a bakery. For each produced box, you are
required to compare its contents to a list of expected items its "template" and determine whether
the box is correct or not. The contents of a box is described by a string such as pcm for 'p'ie,
'c'ookie, and 'm'uffin, or ddp for 'd'onut, 'd'onut, and 'p'ie. The template is described in the same
manner. So given a list of box template pairs, your program should indicate how many times
it found a mismatch between a box and its template and return that total.
A box contains no more than items, and there are no more than boxes to check at a time.
Items in a box can be repeated, so cccookie cookie is not the same as ccookie Items are
not ordered, so the box cmcookie muffin matches the template mcmuffin cookie
Example:
Your program is provided with the following list:
The pair cmmc is valid; the order of items in the box doesn't matter.
The pair ccmmc is invalid; there are too many cookies in the box.
The pair pmmc is invalid; there is a pie in the box, and no cookie.
The pair cmc is invalid; there is a muffin missing in the box.
Given that list, your program should return as it found invalid boxes out of
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
