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.
sorry accidentelly flagged your comment unflagged it.
i think it's because you did not check if bounce was equal to 1, which would cause an infinite loop, the same happened to me
I interpret the instructions as she will always see the ball once no matter what because when the kid drops it, it has to pass in front of her before it can hit the ground then every time it bounces she will see it twice, once on the way up and again on the way down for a second bounce. I hope that helps.
For the puzzle, I tried to go from right to left and checking if the next left digit is larger than the previous one and if so it would replace it. I believe this is my mistake and I am not sure how exactly I should approach this. I am thinking rn if I first go left to right, then right to left repeatly for the length of the string till the number can not be re-oriented to be the smallest digit by swapping with its side numbers. Is this a good approach?
This comment is hidden because it contains spoiler information about the solution
I tried doing something similar, but an issue came up saying it took way to long and I had to use another solution. Maybe I could have optimized another part for it to work. Anyhow, good work.
Im very confused about the instructions. It says that the mother can see the ball both when falling and bouncing. I am probably overthinking this but does the mother see the ball 2 times when it did one bounce because first it comes up and my understanding is it goes out of view and falls where the condition will apply that she saw the ball counting as 2 times.
Or is it that the mother can see the ball the whole time it is above the value of the window but the ball goes out of sight as soon as it is lower than the window height? (If so, I would suggest a specification but I am overthinking this then a lot so even without it, it should be fine for most)
Good solution but u didn't really have to use list over str(num) but regardless, still good solution.
As mentioned above, you can log at certain actions done on the class methods.
I did it! thanks.
No worries, I was just like you when I was trying to solve this kata. Sat in front of my laptop for minutes, confused, until I realize that there's a rank requirement. I thought the
1
is mentioning level.I apologize for jumping to conclusions. I see the mistake. I will focus on improving my code and this kata is very interesting and fun in the ways they want you to come up with the information. Just one final question, i have one last error, how would i view the testcase so I can figure out why the error is triggered?
From the description:
Yes, the level distance is more than
5
(7 - 1 = 6). However, Level 1 and 7 are the same in terms of rank. Both are atPushover
rank. So, it doesn't meet the criteria for defeat, and returns "intense fight" instead.Even after the logging, there are some testcases which aren't possible. One of them asks to output the exp and level being 100 and level 1. Which after it says the battle with a level 7 enemy and return intense battle. How would that be possible? I have checked this like 8 times. Either I'm really stupid or the instructions are written in a unclear manner. I am kinda losing patience with this one, it just doesn't seem that the issue is in my code.
Also, quoting B4B from a post below:
Loading more items...