Ad
  • Default User Avatar

    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

  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Custom User Avatar

    when there are 0

    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.

  • Default User Avatar
    1. '(W : 0)' should equal ''

    2. '' 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