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.
The text not having a comma after the second name messed me up, but after editing those out of my code I got it to pass.
I'll take another look, thanks so much for the speedy reply. It shows my naivete that I didn't know the stack trace was that helpful in debugging. Thank you!
I changed the tests a bit in an attempt to make the failure messages clearer. They look better now, but I wonder if clear enough.
It is unfortunately JUnit giving not very clear feedback in some situations, but the root cause of the error is in your code. Look at the stack trace:
in the line 4th from the bottom you can see that the error comes from the
Imteger.parseInt
, which is un turn called fromSquareDigit.squareDigits
, i.e. your solution. You have a bug in your code, which paired up with the poor test feedback.In Java: When using the sample test, it keeps failing but failing on a string as input? The kata says only accepts and returns an integer. Do I need to be cleaning the input? Text from the error here: Test Results:
SquareDigitTest
test
For input string: "813611416183156161"
I am pretty new to CodeWars, I am returning an integer via return, not print.