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.
there's no argument for the input in the initial solution
Hi,
0
input case makes no sense (yeah, it's described, but that still makes no sense to expect 0 while it could return 1...)Cheers
it will check the if-condition with every recursive call, doesn't need to
Perhaps its only me but i thought
If n is the greatest possible number with its set of digits, then return 0
means 99 should to send back 0 as next number has more digits then 99 (100).spoiler flag...
Not evident to find the pattern :p
This comment is hidden because it contains spoiler information about the solution
It is the first
bug
kata I solved. I don't know if allbug
problem are about compiletime error but it's not for me hihiThe given number should be positive.
But I think now, it would be good too with negative number.
Why does
nextInteger(0)
should equal to0
and not to1
?This comment is hidden because it contains spoiler information about the solution
Minor improvement:
return
is not a Java function but a Java keyword. You don't have to (and should not) write parentheses around the the return value unless you need it for the correct order of some calculation or casts.DO:
return 0;
,return null;
return (2 + 3) / 5;
,return (int) 2.5;
AVOID:
return(0);
,return (null);
,return ((2+3)/5);
,return((int) 2.5);
Fixed
Fixed
So should I use my own solution to generate radom test? It is my first kata :)
Loading more items...