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.
This Kata would benefit greatly with an example of the failed test case, instead of the expected equal alone. The basic test case is not enough for this Kata.
On the test example "new int[] {-10, 1, 0, 1, 10}" the result should be -10 even tho -10 and 10 have the same amount of DIGITs and on the random test "new int[] {1308500879, -1807002044}" even tho 1308500879 and -1807002044 have the same amount of DIGITS...............
i completely don't understand the logic of this kata since the numbers are not selected by the number of their digits and neither by the number of the CHARACTERS of each number (-10 has 3 characters over 2 character in 10 but they both have the same amount of digits....... but -1807002044 has 11 characters and 1308500879 as 10 characters even tho both have the same amount of digits).
So in conclusion i don't understand at all what this kata wants and i don't think it works properly.
I did everything according to the instructions and generated code that measures the length of the string. The tests go fine, but when I press "Attempt", it throws an error- "expected: <1874011478> but was: <-1974269008>"
I don't understand how there's a comment from a year ago that says the R tests are wrong and it's still wrong. It's still counting values that are shorter as the correct answer over values that are 1 digit longer. How does this get fixed?
Some languages have tests with negative values while some do not, and the expected behavior is not specified.
Issue with the random tests in R.
Despite
1e+17
having one more digit it is expecting1.14e+16
.This comment is hidden because it contains spoiler information about the solution
Random test is failing for me in Java.
randomTests(SolutionTest)
expected:<-449970540> but was:<-73742809>
I've tried running my code with those values in an array and I correctly return the expected value, so there must be a problem with the random test.
This comment is hidden because it contains spoiler information about the solution
For Java, exampleTest6 fails if the negative sign is not counted as a digit, but randomTests fails if the negative sign is counted.
Does the negative sign count as a digit or not?
random test doesn't seem to work. I get two numbers with the same number of digits (10), one of them is negative, hence (as implied by the sample tests) the negative one should win - it has one more digit!
Output: expected:<1042331394> but was:<-1292852934>
This comment is hidden because it contains spoiler information about the solution