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.
f for everyone who is wasteing his time with this kata xd
Well that was a complete waste of my time....XD
Could you post your code (with a spoiler tag)?
dumb....-_-
Use the spoiler flag dammit.
This comment is hidden because it contains spoiler information about the solution
Yea no test n<100 so dumb :D
so troll
It takes me 5 minutes to solve. There is so complex description that solution must be very simple. First try and kata has solved.
But isn't the check performed at the start of the expression? Array length will always be greater than or equal to zero. If the value of n is negative then the function returns -1 in this solution.
Edit:
Okay, I'm dumb :D
@vasyl.shevchuk.78
yes you are right. It would be better to test for it. But the Kata description was a bit vague about the possible values ofn
and since that case is never tested so I assumedn >= 0
always.Read about "?" operator in java.
This comment is hidden because it contains spoiler information about the solution
Me either, tried diffrent approach - works in Ide, throws runtime error here.
It is indeed. But as you said: excersise.
Loading more items...