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.
No.
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
This is an exciting problem. I got what's the problem with my approach.
I found a pattern and used it.
Thank you!!
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)
Description is good and gives the right background for the problem.
Including more testcases would be helpful.
yes, it is working with the examples.
It worked for the large number test as well.
Thanks : )
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.
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.
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
Does your solution work with the example tests?
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.
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?
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.
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...