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.
Groovy Translation
not a question
OP solved the kata
you altered the return type of the method. it should return a
List<Object>
, not aList<Integer>
. the input list can contain potentially any type, therefore so can the output, expectString
sWhere is my error ? :src/test/java/SolutionTests.java:43: error: incompatible types: List cannot be converted to List
List result = Kata.filterList(List.copyOf(input));
^
1 error
Agreed.
You have a typo in the example namely in the output of the last number:
ListFilterer.GetIntegersFromList(new List<object>(){1, 2, "a", "b", "aasf", "1", "123", 123}) => {1, 2, 231}
There should be:
ListFilterer.GetIntegersFromList(new List<object>(){1, 2, "a", "b", "aasf", "1", "123", 123}) => {1, 2, 123}
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/227.
Please join the discussion to help us identify duplicate kata and retire them.
Posting a spoiler solution is not a kata issue, it's a user issue.
This comment is hidden because it contains spoiler information about the solution
so easy, so fun!
Not a kata suggestion
More Optimal
the situation depends on the language. in C# and F# at least, the user's solution is required to return a list of
int
by the type signature, while e.g. Java returns a list of objects. there has likely been some translation drift over time, as this is a very old kataHi, I replied to your other comment. I see your logical point, though. Would you like to consider re-writing the description? You could leave that posted with a suggestion flag.
Loading more items...