Curtain Factory — Max Aqua Curtains in Any Box
E · easyP · Verified PYQstrings
Problem
String of a/b chars (N length). Pack into boxes of L chars. Find box with MAXIMUM number of ‘a’ chars. Leftover chars after N//L groups form another box.
Constraints
1<=L<=10, 1<=N<=50
Example
Input
bbbaaababa 3
Output
3
chunk string in groups of L using range(0,len(s),L). Count 'a' in each chunk. Return max.
Groups of 3: bbb, aaa, bab, a. Max a count = 3 (group 2).