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.
I'm curius whether we're supposed to return each number or print it. I am not aware of any ways to repeatedly return value from a method. As far as i know, once a return statement is executed the program exits from the function. This is why I have choosen to use the "println" method as well.
then you are wong, I believe. ;)
What I was saying is that I bet that the assertion message doesn't show is that returned list is
List.of("")
while it has to beList.of()
or any other version of an empty list. Problem being that the assertion message show the stringified version of the returned list, in whichList.of("")
will show up in the exact same way thanList.of()
. So there is definitely no issue here and it's just about foloowing the logic of the problem correctly. ;)EDIT: just to make things clear: I even checked that the assertions pass correctly returning any of those:
List.of()
,Arrays.asList()
ornew ArrayList<>()
. So definitely no issue, yeah.I meant HE is right, I think it should not be difference between an empty List and a Array.toList() as the function is expected to return a List
okay, so closing.
@ArturoJafet: those are in the sample tests, you could have seen it by yourself, actually. ;)
I would suggest to add upper case examples to avoid confusion.
You are right, it is a Type bug with empty arrays. I do this workaround: if result.length == 0 return Arrays.asList()
mmm, my bet: your list isn't empty but contains an empty string (that isn't showing up in the assertion message, so). If that's it, close the issue.
with what input? What are you returning exactly (on the coding side: what statement is it on your side?)
This comment is hidden because it contains spoiler information about the solution
You're right, i'm new to this. Thank you! i've figured out my problem. I'll be more careful next time.
What you say seems a bit unclear for now.
...the randomly generated test cases measures all occurences of the returned strings as substrings in the input text.
-> nope:
So, doesn't match at all what your saying.
Really sounds like an invalid issue, so closing. If I'm wrong, reopen a fresh one, but this time, do it "right":
cheers
oh, that is actually way simpler than that. The problem is on your side:
okay. Can you give me your output on those, please?
I have noticed that the randomly generated test cases measures all occurences of the returned strings as substrings in the input text. So if one the strings i outputed was "mhvhd" and "mhvhdmhvhd" was part of the string generated by the text function it expects that "mhvhd" should be counted twice. The test function isn't working on the same delimeters as the instruction. Atleast this is the case in java.