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.
This comment is hidden because it contains spoiler information about the solution
What language is this? It should just be expecting that an exception is thrown if an empty list is created.
Do you mean you want to use a for loop or similar to do all the tests, instead of random_test_1, random_test_2, random_test_3, etc.? I don't know C++ very well - is it possible to make an array or list instead of std::initializer_list, and then cast it to std::initializer_list? That is what the python and kotlin tests do with the * operator? Is there an equivalent in C++?
Is this in the Kotlin or the Java kata? If Kotlin, then it expects the Kotlin Exception class, not java.lang.Exception
thanks!
Made a kotlin translation here https://www.codewars.com/kumite/5eb6a38e7cd701001e5019a7
There is no implementation of the Node class so it is not possible to get the solution and test cases running in an IDE instead of using the CodeWars web GUI
I think the tests are broken in kotlin:
fixture.kt:15:48: error: unexpected tokens (use ';' to separate expressions on the same line)
assertEquals(incrementString("009"), "010")`
The caret points to the backtick (`) and I think that is why it won't compile
Now resolved in both languages. Thanks for the feedback
Now resolved in both languages
Good point, I will address this issue :)
Hey thanks for the comment. I wasn't trying to create a legitimate data structure that would be good in the real world, it was more meant to be a fun challenge to code something that follows the made-up rules of this made-up data structure.
You're absolutely right, thanks for spotting. It looks like another user has already managed to edit it somehow so should be all good now
Makes a lot of sense... just like
listOf(1)
is fine but you have to dolistOf<Int>()
to get an empty one. Thank you I will add tests in both languagesThanks for the feedback - will do
Loading more items...