Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
C translation kumited
input a was: 20 , input b was: 9
Expected: '2 group(s) of 9 & 1 group(s) of 8', instead got: '2 group(s) of 10'
Test cases are broken. 2*9+8 is 26, which is, as you'd agree, more than 20.
The random tests don't compute:
5 * 7 + 6 == 41
4 * 9 + 8 == 44
Edge cases are unspecified.
groupSizer(7,5)
is just impossible andgroupSizer(5,2)
is ambiguous.Why stringify everything? An
Array
ofNumber
s return value would have been perfectly serviceable.[]
might signify an impossible grouping, or you can throw anError
.Use appropriate datatypes!
Can't figure this out at the moment. The description seems incomplete or at least hard to understand.
This is what I get from the description:
students
,groupSize
groupSize
.In some tests, there are too few left over for a new group but too many to add only 1 to each existing group.
How would subtracting from groups help distribute the remaining students into the groups?
There is nothing saying what order to put the returned group sizes in.
I'm guessing maybe you actually want for all groups to be (1) as close as possible to each other, and (2) for the average group size to be as close as possible to the specified desired group size. Though it's hard to see what exactly the rules are for when to go with (1) vs (2).
Also, I'm still not sure about that return formatting question.