Ad
  • Custom User Avatar

    Hmm..
    I have write a Java solution and submit it.
    It seems no error in the tests.
    Made some changes in the random tests:

    1. Added "Testing for candies = [...]" 
    2. Added "Expected: [...], instead got: [...]" when testcase failed.
    

    Some possible problem in your code(just guess):

    1:
    When candies = [single integer]
    your code should return [0,n], instead of [1,n]
    2:
    don't modify the input array.
    
  • Custom User Avatar

    Can you paste your code here and mark it as having spoiler content?

  • Custom User Avatar

    Ah, sorry. I haven't seen your reply :(
    It seems that you are using JAVA?
    I copied this testcase to the fix test, it returns {78,20}
    I think the JAVA translation mey contains errors, but I don't know JAVA.
    Let me try, or waiting for @theropodMusings to check it.
    Thanks for your feedback ;-)

  • Custom User Avatar

    Thanks -- I'm glad you enjoyed it and that you figured out the problem!

  • Custom User Avatar

    On one hand there have been 91 successful Java completions so far, so I assume the random tests are OK, but on the other hand bugs can always turn up. Do you want to try posting your solution as a reply, and then marking it as a spoiler, and I can take a look at it? (I haven't asked anyone to do that before, but I would think that as the kata author I should be able to see comments marked as spoilers.)

  • Custom User Avatar

    Hi! What language are you using?

  • Custom User Avatar

    Are you sure that your result is right?
    Please give me the input data, thanks ;-)