Question: In a space with dimensions width: , height: , and depth: , boxes are stacked with a width, height, and depth of 1 each (
In a space with dimensions width: height: and depth: boxes are stacked with a width, height, and depth of each a total of Boxes Each box is marked either or Now, considering all the pairs of coordinates, what is the maximum number of boxes stacked continuously along the axis marked A
For illustration, we represent as yellow, and as blue.
Example The maximum number of continuously stacked s along the Zaxis, which is yellow, corresponds to boxes at coordinate
The order of inputs for the marks on the boxes is: red arrow in right figureXYZXYZXYZXYZXYZXYZXYZXYZXYZ The input consists of the dimensions of the space width height, depth and the marks on the boxes given as a string.
Input is provided by using cin and the result is displayed by using cout in Problem In other words, the text is provided by keyboard typing.
The first line contains three integers X Y Z separated by space
After you receive the input X Y Z validate the input using the function isvalid
You have to utilize the function isvalid in the main function. Otherwise, you will receive a deduction of points.
Implement the function isvalid with the following specifications:
The function isvalid receives three arguments XYZ
It verifies if these values, X Y Z are within the range of $ X Y Z $
If inputs are valid, return Otherwise, return If inputs X Y Z are invalid, receive an input text X Y Z again until its valid.
If inputs are valid, receive the next inputs array of characters If input X Y Z is valid, get an input text whose length is the range of is
After receiving the input text, validate it
The length of the text equals
Whether the text contains only A or B If it contains other characters such as C or Q it is not valid. If the input is invalid, receive the text again, until its valid.
Output Format
Display the maximum number of boxes stacked continuously along the Zaxis marked A by using
cout
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
