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
Oh, you're right. I wasn't seeing the correct logs.
Sorry.
You would be correct, however I am saying that when I run your code, I don't see this behavior. Are you sure you aren't misreading the logs?
Here is what I see after running your code a few times:
You may be mistaking the log above the "returned... received..." part as the log for the failed test, but it's not. Note that when you print the values of
arr
, your loop prints one value too many (you're printing a value in memory right after the array), which can lead to confusing looking logs.Sorry. Maybe I didn't understand.
If arr_sz is 19, the arr object will stop at 19, right? So, the expected output can't be 21, because the number is greater than the arr_sz
Is it correct?
I could not replicate this with your current code, but there is no mistake. Your current code doesn't check the last number of
arr
.This comment is hidden because it contains spoiler information about the solution