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
Problem with this solution is that it will return incorrect results if the collection contains numerical strings. For example,
["13", "42"]
should result in[ ]
because the array contains no ints, but your solution will return[13, 42]
.I can see one problem with failure messages tho. String elements are not quoted, what makes it impossible to tell
7
from"7"
on failure. (EDIT: fixed)This comment is hidden because it contains spoiler information about the solution
It is not a proper way to raise an issue. I cannot fix anything if I do not know the languag you attempt, and your code.
For input [908, 134, 416, , o, 5, R] expected:<[908, 134, 416]> but was:<[908, 134, 416, 5]>
For input [1, 2, 'aasf', '1', '123', 123] expected:<[1, 2, 123]> but was:<[1, 2, 1, 123, 123]>
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
Loading more items...