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.
My solution setup is List, I changed it a while ago. I don't know if you have to re-approve it or something!
There's no requirement in Java for classes to be in seperate files. It's obviously best practice in the real world but for simple academic exercises such as these it's perfectly acceptable to have all the classes in one file.
You're on the right track trying to look for other information about the class!
I would just make it explicitly clear in the description that the goal is to fix the syntax error.
To quote acraileanu from some other comments here: "Most likely this is a type issue (you return a string and the assert is expecting an integer).". Hope that helps!
Done too. :)
This comment is hidden because it contains spoiler information about the solution
Done.
I forgot to copy accros the example test cases to the actual tests!
Submitted Java translation.
Submitted a Java solution.
Added a Java translation.
Sorry, the setup code should be List not List! The reason it doesn't work with List is that some of the tests cases include Strings, and one includes both Strings and Integers. So the return type of the function needs to be List, and items needs to be of type List too. Alternatively a generic solution would work as you found. Java doesn't deal with mixed lists as well as other languages, like Python, so it is a slightly unusual thing to be doing, but I kept the tests consistent with the Python version. I'll fix the setup code and missing import statement, thanks for pointing those out!
Using the variable name "map" in Python conflicts with the built in map function. I was stuck for ages trying to work out what was causing the error when I tried to use the map function! I'd suggest changing the name to cave_map or something.
Written a Java translation for this one too!
Enjoyable kata! I've written a Java translation if you want to take a look.
Loading more items...