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.
I tried it both ways. If I return 0s I get more errors in random tests. If I return "" I get less errors. But still get errors
B1ts please take a look at fixed test 4(at least in java): it asks for 4 nonexistent categories, and expects them return nothing.
I agree that handling of empty categoroes is confusing in this problem, but it is covered by the last statement of the "Task" section. its not an error with test cases, but with poor output of tests coupled with strange arbitrary requirements in the spec.
0 is quantity.
If I live code like this:
if check == 0:
return ''
I get errors like:
'' should equal '(P : 0)'.
If I do this:
#if check == 0:
# return ''
If get errors:
'(H : 0) - (Q : 0)' should equal ''
To me it looks like random test is wrong.
When there are 0 of what? Arguments? Quantity? It doesn't matter how many there are, you need to add every category to the result (even if there's no books). Printing function arguments might help.
I ran your current code and a random test with
stocklist = ['WQHXKEHMJC 201', 'LYUYOJBCUT 158', 'BDZVLXTMTA 562', 'KQBYGDDWLL 928']
,categories = ['R']
returned''
, when the expected result is'(R : 0)'
. The result is based on categories, and seems correct to me.There's no issue with kata results that I can see, but feel free to reply.
'(W : 0)' should equal ''
'' should equal '(W : 0)'
if I make it return '' when there are 0 it gives error 2. If I return number of books it gives error 1