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.
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...?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.