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.
look for the difference in these two lines:
[[M: 37 B: 5 C: 4][][M: 100 B: 14 C: 11]...
[[M: 37 B: 5 C: 4][, ][M: 100 B: 14 C: 11]...
This comment is hidden because it contains spoiler information about the solution
No problem for me. I added in "Your example test cases":
assertEquals("[[M: 9991 B: 1427 C: 1110]]", Carboat.howmuch(9990, 10000));
and the tests passed. But if I put
assertEquals("[[M: 9990 B: 1427 C: 1110]]", Carboat.howmuch(9990, 10000));
which is false because of
9990
instead of9991
I'm getting
the extra brackets which you found weird are there to show where the strings are different! Hope that will help you!
Java tests are correctly written but for a reason I don't know the output of square brackets in CW is weird:-(
Note in "Your example test cases" and "Your solution" that in Java the function returns a string which kind of mimics an array.
In "Your example test cases" you could read:
which, as you can see is correctly written.
Many Codewarriors passed the kata in Java without problems. I just tried myself and everything went fine.
The general workaround is to write faster code.
Although for this kata, I can't really imagine an answer which is too inefficient.
Infinite loop/recursion is more likely.
Could you post your code here? (Mark it as spoiler)