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.
my codes instantly worked after moving the global variables into the class under public:
As far as I see, every tests gets its own instance of
SnakesLadders
, so there should be no need to reset anything. It is difficult to say what is wrong with your solution without seeing your code, but maybe you are using some global or static data instead of instance fields?my code written in C++
the stored player positions is not reset after the example tests and is carried on to the random tests, and that is causing errors
since the game hasnt ended in example tests, i can't reset the game before the random tests begin
anyone has any idea on how to make this work
Logical I don't understand how is the right solution 5, I think it' 4.
For example, if your size is
2
and you encounter a fish of size3
, you must wait to be of at least size3
to eat it (if you ever reach size3
). Your solution don't take size into consideration.Your solution re-eats the same fish for each level.
Can anyone explain me:How we get for "111111111111111111112222222222" the length of the fish is 5?
This comment is hidden because it contains spoiler information about the solution
I tried OP's code and it does not handle cases where the fish grows to sizes beyond what is mentionned in the description. the confusion about the input is probably due to the tests suite logging the input to the console instead of making it part of the assertion message. i've fixed that and enabled Node 18+. there is already a suggestion about the lack of clarity of the description (it's not clear that we have to deduce a formula from the table)
question answered by PetitLu117
fixed and added better assertion messages
In the description there is a table that describes how a fish grows. But the table ends with fish size 7, so I assumed that growth is limited.
Only the other fishes from the shoal ranges from 0 to 9. You (the growing fish) are not limited in size.
I have not solved this myself so I can only speculate. I suspect that the input fish are limited to single digit ranges but that your own size can grow as large as the food eaten allows. Perhaps there is a pattern with regards to how much you eat and how big you get? Maybe we should consider ourselves a special fish that can gorow past the limits of all other fish? I realize that I am answering with more questions to a question, sorry about that.
C#: How can the expected fish size be 13 if the fish size ranges from 0-9?
Can anybody help me?
This comment is hidden because it contains spoiler information about the solution
Loading more items...