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.
In JavaScript console.log(array) can be used for this purpose. I don't know about other languages
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.
Same thoughts. I'm moving on rather than hitting my head against a wall.
From the description:
10760 = 5 digits,
17204 = 5 digits,
95013 = 5 digits,
6474 = 4 digits,
42 = 2 digits
So, the max amount of digits is 5. Since there are multiple that have length 5, take the one that comes up first. And that is
10760
.Log
[ 1, 10, 100 ]
100
[ 9000, 8, 800 ]
9000
[ 8, 900, 500 ]
900
[ 3, 40000, 100 ]
40000
[ 1, 200, 100000 ]
100000
[ 7000000, 10, 100 ]
7000000
[ 30744, 220584, 48, 58140, 155610 ]
220584
[ 14036, 0, 21889, 20880, 217080 ]
217080
[ 10760, 17204, 95013, 6474, 42 ]
95013
expected 95013 to equal 10760;
Bro, what the hack?! Look at the last line. How should it work lol?
This should be a 6kyu. Thanks.
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.
The kata seems to be tricky at best, or even underspecified.
Your solution most probably returns incorrect answer for inputs like
int[] { 21, -10, 212 }
.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>"
Enjoyed it. Hope to see more like this.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
OP solved it, closing
This kata has no clear discription and exmaples!!!
Loading more items...