Ad
  • Custom User Avatar

    look into types ;)

  • Custom User Avatar

    Thanks, edge case :) No it work

  • 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

    @myjinxin2015
    Hi, any clue why isn't working?

  • Custom User Avatar

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

  • Custom User Avatar

    Case close.
    It was my fault. Edge case :)
    Very good Kata :)

  • 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
  • Custom User Avatar

    Hi! What language are you using?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Sample test works OK.
    "2, 15, 8, 14, 7, 2, 3, 11, 7, 19, 6, 16, 15, 19, 19, 5, 5, 17, 4, 5, 5, 12, 13, 1, 17, 4, 5, 11, 3, 4, 5, 11, 5, 3, 13, 15, 11, 19, 17, 16, 5, 4, 6, 5, 12, 17, 15, 3, 17, 6, 4, 7, 10, 5, 8, 5, 9, 2, 17, 13, 13, 19, 1, 14, 18, 15, 4, 4, 1, 14, 9, 1, 8, 16, 17, 13, 13, 16, 9, 12, 13, 2, 10, 14, 16, 15, 18, 17, 2, 16, 16, 9, 14, 3, 8, 12"
    it's one of test. It return "expected:<[[0], 12]> but was:<[[1], 12]>"
    In my local environment response is "78, 20"

  • Custom User Avatar

    Removed(from initial code, not preload).

  • Custom User Avatar

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

  • Loading more items...