Question: A furnishing company is manufacturing a new collection of curtains. The curtains are of two colors aqua(a) and black (b). The curtains color is represented as a string(str) consisting of a's and b's of length N. Then, they are packed (substring) into L number of curtains in each box. The box with the maximum number of 'aqua' (a) color curtains is labeled. The task here is to find the number of 'aqua' color curtains in the labeled box. Note: If 'L' is not a multiple of N, the remaining number of curtains should be considered as a substring too. In simple words, after dividing the curtains in sets of 'L', any curtains left will be another set(refer example 1) Example 1: Input: bbbaaababa -> Value of str 3 > Value of L Output: 3 Maximum number of a's Explanation: From the input given above. Dividing the string into sets of 3 characters each Set 1: {b,b,b} Set 2: {a,a,a} Set 3: {b,a,b) Set 4: {a} -> leftover characters also as taken as another set Among all the sets, Set 2 has more number of a's. The number of a's in set 2 is 3. Hence, the output is 3.
Question: A furnishing company is manufacturing a new collection of curtains. The curtains are of two colors aqua(a) and black (b). The curtains color is represented as a string(str) consisting of a's and b's of length N. Then, they are packed (substring) into L number of curtains in each box. The box with the maximum number of 'aqua' (a) color curtains is labeled. The task here is to find the number of 'aqua' color curtains in the labeled box. Note: If 'L' is not a multiple of N, the remaining number of curtains should be considered as a substring too. In simple words, after dividing the curtains in sets of 'L', any curtains left will be another set(refer example 1) Example 1: Input: bbbaaababa -> Value of str 3 > Value of L Output: 3 Maximum number of a's Explanation: From the input given above. Dividing the string into sets of 3 characters each Set 1: {b,b,b} Set 2: {a,a,a} Set 3: {b,a,b) Set 4: {a} -> leftover characters also as taken as another set Among all the sets, Set 2 has more number of a's. The number of a's in set 2 is 3. Hence, the output is 3.
Chapter16: Graphics
Section: Chapter Questions
Problem 14RQ
Related questions
Question
31. Need C, C++, Java, Python, or Perl code for the below question. Important: Do not copy codes from prepinsta.com.
![Question: A furnishing company is manufacturing a new collection of curtains. The curtains are
of two colors aqua(a) and black (b). The curtains color is represented as a string(str) consisting of
a's and b's of length N. Then, they are packed (substring) into L number of curtains in each box.
The box with the maximum number of 'aqua' (a) color curtains is labeled. The task here is to find
the number of 'aqua' color curtains in the labeled box.
Note:
If 'L' is not a multiple of N, the remaining number of curtains should be considered as a substring
too. In simple words, after dividing the curtains in sets of 'L', any curtains left will be another
set(refer example 1)
Example 1:
Input:
bbbaaababa -> Value of str
3 > Value of L
Output:
3 Maximum number of a's
Explanation:
From the input given above.
Dividing the string into sets of 3 characters each
Set 1: {b,b,b}
Set 2: {a,a,a}
Set 3:{b,a,b}
Set 4: {a} -> leftover characters also as taken as another set
Among all the sets, Set 2 has more number of a's. The number of a's in set 2 is 3.
Hence, the output is 3.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F2bb17e7e-2ebe-4c45-b40e-6cf48e363ffb%2Fd5e866db-432d-407b-b1e8-520a15889c30%2Fyy7e4yr_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Question: A furnishing company is manufacturing a new collection of curtains. The curtains are
of two colors aqua(a) and black (b). The curtains color is represented as a string(str) consisting of
a's and b's of length N. Then, they are packed (substring) into L number of curtains in each box.
The box with the maximum number of 'aqua' (a) color curtains is labeled. The task here is to find
the number of 'aqua' color curtains in the labeled box.
Note:
If 'L' is not a multiple of N, the remaining number of curtains should be considered as a substring
too. In simple words, after dividing the curtains in sets of 'L', any curtains left will be another
set(refer example 1)
Example 1:
Input:
bbbaaababa -> Value of str
3 > Value of L
Output:
3 Maximum number of a's
Explanation:
From the input given above.
Dividing the string into sets of 3 characters each
Set 1: {b,b,b}
Set 2: {a,a,a}
Set 3:{b,a,b}
Set 4: {a} -> leftover characters also as taken as another set
Among all the sets, Set 2 has more number of a's. The number of a's in set 2 is 3.
Hence, the output is 3.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT