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
your list isn't typed, apparently (but maybe that's because the generic type as been swallowed as a tag by themarkdown engine...)
I checked (again), and my solution passes in Java 11 and 8 while returning either
Arrays.asList()
ornew ArrayList<String>()
, or evenList.of()
for J11. So I guess that your function is getting "true" for the condition, then add an empty string somewhere while it shouldn't...?This is the problem I'm stuck on, I don't think this is actually completeable. using my IDE I coded up this:
List al1= Arrays.asList();
List al2= Arrays.asList();
pln(""+al1+al2); //[][]
pln(""+(al1==al2)); //false
pln((Arrays.asList()==Arrays.asList())+""); //false
Java will always compare the references here and not the content so idk how people passed this in java
if there are no words, then this is what is outputted:
List finalout = new ArrayList<>();
if(!wordlist.isEmpty())
//do things to fill in the list
return finalout;
I don't know the intricicies of java enough to know if that creates an empty string within the array list.
.
Sure: 99% of chances that you have an array list with an empty string inside (hence a list of length 1) instead of an actual emtpy list.
Can someone help me understand what i'm doing incorrect to be getting this error?
I'm in java:
expected: java.util.Arrays$ArrayList<[]> but was: java.util.ArrayList<[]>
This comment is hidden because it contains spoiler information about the solution