Cooking factory
https://pastebin.com/SC92r21L Здравейте! Judge дава 70/100, някой може ли да открие грешката?
Problem 3. Cooking Factory
The George`s Cooking factory got another order. But this time you are tasked to bake
the best Bread for a special party.
Until you receive a command "Bake it!" you will be receiving strings, the batches of bread. Each string is an array of numbers, split by "#". Each element is a bread and the number represent its quality.
You should select the batch with the highest total quality of bread.
If there are several batches with same total quality select the batch with the greater average quality.
If there are several batches with same total quality and average quality, take the one with the fewest elements (length).
Input / Constraints
- Until you receive a command "Bake it!" you will be receiving strings, the batches of bread. Each string is an array of numbers, split by "#". Each element is a bread and the number represent its quality.
- Each batch will have from 1 to 10 elements.
- Bread quality is an integer in the range [-100, 100].
Output
- After you receive the last command "Bake It!" you should print the following message:
"Best Batch quality: {bestTotalQuality}"
"{bread batch, joined by space}"