Ad
  • Custom User Avatar

    No.

  • Custom User Avatar

    Please help me understand why these testcases are failing in Java. I'm banging my head for quite a few days what's wrong with my code.

    test(RemovedNumbersTest)
    Log
    Random test 0
    Random test 1
    Random test 2
    Random test 3
    Random test 4
    Random test 5
    Random test 6
    Random test 7

    test10(RemovedNumbersTest)
    ✘ Arrays not the same length

  • Custom User Avatar

    This is an exciting problem. I got what's the problem with my approach.
    I found a pattern and used it.
    Thank you!!

  • Default User Avatar

    The problem is probably that your algorithm is to slow for the numbers used in the submit tests as they are much larger than the numbers used in the example tests.

    Edit:

    If your solution returns 17179869183 when n = 10000000000 in a short amount of time you should probably be able to pass

    (Note: this is just an example of a case where iteration won't work, there are however even large tests)

  • Custom User Avatar

    Description is good and gives the right background for the problem.
    Including more testcases would be helpful.

  • Custom User Avatar

    yes, it is working with the examples.
    It worked for the large number test as well.

  • Default User Avatar

    Thanks : )

  • Custom User Avatar

    I don't get why my solutions is not working.
    As others pointed, test cases has int[] but the solution expects long[].
    Pls help to resolve.

  • Custom User Avatar

    very nice kata that forces the coder to go a step further to optimise the code, as first brute force solution does not work.
    Upvoted.

  • Custom User Avatar

    Well, it takes 318ms when I test using the 'Run tests' button, so I do not think I need to make it faster, or is there something I am missing?

    Can I post my code for you to review?

    Thanks

  • Default User Avatar

    Does your solution work with the example tests?

  • Custom User Avatar

    This is the tests telling you that your solution is too slow when run a lot of times on big numbers.
    You'll either have to find a way of speeding up your current algorithm or find a different one which is faster.

  • Custom User Avatar

    Pls guide me!!
    My solution works in IDE.
    I have used BigInteger.compareTo for looping and BigInteger.or() method for bitwise or operation.
    Could you pls tell why is it not working in Kata?

  • Custom User Avatar

    Maybe I am naive. Pls guide me.
    I have tried these cases.

    a == null || b == null
    a.length == 0 || b.length == 0
    if both arrays are equal.

  • Custom User Avatar

    should_test_predefined(ReverseTest)
    hello world expected:<12> but was:<11>

    Could someone pls explain the error?
    How is it expecting 12?

  • Loading more items...