tidying coloured bricks into boxes
Description:
Task:
There are several coloured blocks laying around, you are to tidy them away into boxes, each box can hold up to 10 coloured blocks, and there should be no more than 2 different coloured blocks in the same box.
you will be given a dictionary mapping the number of each coloured brick to its colour
Additional Info:
the number of different colours is not fixed, but is at least 1
the total number of coloured blocks is equal to the total storage available in the boxes
the number of boxes is equal to the number of colours that the blocks can be found in
Examples:
Given {"blue":4,"red":16}, your function should return something similar to:
[[("blue",4),("red",6)], [("red",10)]]
Given {"blue":4,"red":16,"green":7,"black":13}, your function could return:
[[("blue",4),("red",6)], [("red",10)], [("green",6),("black",4)], [("green",1),("black",9)]]
the number of each colour in a given box should be returned as a tuple
Similar Kata:
Stats:
Created | Jan 28, 2025 |
Published | Feb 1, 2025 |
Warriors Trained | 21 |
Total Skips | 0 |
Total Code Submissions | 133 |
Total Times Completed | 10 |
Python Completions | 10 |
Total Stars | 3 |
% of votes with a positive feedback rating | 50% of 3 |
Total "Very Satisfied" Votes | 1 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 5 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |